id |
shows user&group ids of the current user |
last
| shows the last users logged on |
whoami |
shows who you are logged in as |
who |
shows who is logged into the system |
w |
groupadd test creates group “test” |
useradd -c “GK” -m Gokhan |
creates “Gokhan” account with comment “GK” |
userdel Gokhan |
deletes account “Gokhan” |
usermod -aG Networkers Gokhan |
adds account “Gokhan” to the “Networkers” group |
touch abc |
creates an empty file named abc |
cat abc |
used to view file abc |
less abc |
browse through a text file abc
|
head abc |
displays first 10 lines of file abc |
tail abc |
displays last 10 lines of file abc
|
tail -f abc |
displays last 10 lines of file abc and follow it as it grows |
tail -F abc |
outputs last lines of abc as it changes |
file abc |
gets type of abc |
gpg -c abc |
encrypts file abc |
gpg abc |
decrypts file abc |
dir |
shows files in the current directory |
put abc |
uploads file abc from local to remote device |
get file |
downloads file abc from remote to local device |
grep x file |
searches for x in file |
grep -i |
case insens-itive search |
grep -r |
recursive search |
grep -v |
inverted search |
grep -o |
shows only matched part of the file |
find /dir/ -name aaa* |
finds files starting with aaa in dir |
find /dir/ -user Gokhan |
finds files owned by Gokhan in dir |
find /dir/ -mmin 10 |
finds files modifed less than 10 minutes ago in dir |
find /home -size +500M |
finds files larger than 500MB in /xyz |
find [/folder/location] -name [x] |
finds file names starting with character x |
whereis aaa |
locates the binary, source, and manual page of aaa |
locate abc |
finds the location of abc quickly |
command -h / command –help |
to review all available options of the “command” |
info command |
to find info documents about the “command” |
whatis command |
displays a single line description about the "command" |
$ man UNIXCOMMAND |
to view detailed man page of the “command” |
apropos |
used to search man pages for available commands on a specific |
ps |
displas currently running processes |
ps PID |
give the stats of a particular process |
pidof |
gives the process ID of a process |
ps -ef |
displays all running processes on the system |
ps -ef | grep xyz |
displays process information for xyz |
top |
displays and manages the top processes |
htop |
interactive process viewer (top alternative) |
kill pid |
kills process with process ID of pid |
pkill xyz |
kills process with name xyz |
killall abc |
kills all processes named abc |
program & |
starts program in the background |
bg |
lists and resumes stopped jobs in the background |
fg |
brings the most recent background job to foreground. |
fg x |
brings job x to the foreground |
nice |
starts a process with a given priority |
renice |
changes priority of an already running process |
pstree |
displays processes in a tree-like diagram |
pmap |
displays a memory usage map of processes |
lsof |
lists files opened by running processes |
gzip abc |
compress abc file using gzip |
bzip2 abc |
compresses abc file using bzip2. |
zip abc.zip abc |
compresses abc file into the archive abc.zip. |
tar -czvf archive.tar.gz /home/temp2/ |
Compress a full directory with all subdirectories |
gzip -d xyz.gz |
extracts xyz.gz with gzip utility |
gunzip xyz.gz |
extracts xyz.gz with gzip utility |
bzip2 -d file.php.bz2 |
extracts xyz.gz with bzip2 utility |
bunzip2 file.php.bz2 |
extracts xyz.gz with bzip2 utility |
unzip xyz.zip |
extracts xyz.zip with zip utility |
gunzip -c output.txt.gz |
to view the contents of both files without extracting |
tar cf archive.tar directory |
creates tar named archive.tar containing directory |
tar xf archive.tar |
extracts the contents from archive.tar |
tar czf archive.tar.gz directory |
creates a gzip compressed tar file name archive.tar.gz |
tar xzf archives.tar.gz |
extracts a gzip compressed tar file |
tar cjf archive.tar.bz2 directory |
creates a tar file with bzip2 comression |
tar xjf archive.tarbz2 |
extracts a bzip2 compressed tar file |
arp |
displays ARP table of the device |
arpwatch |
displays ethernet activity and Ethernet/ip pairings |
bmon |
displays bandwidth, captures |
curl |
used for file transfer |
dhclient |
used to analyze clients ip address, subnet mask, gateway, dns server |
dig |
used for simple DNS lookup |
dstat |
collects and shows system resources |
ethtool |
used to check settings of your NIC |
ftp |
used for file transfer |
host |
used for IP-name matchings |
hping3 |
used for packet analyze |
ifstat |
used to monitor network interface statistics |
ip addr |
used to check network interfaces and routing activitie |
iptables |
used for ip packet filtering |
iftop |
displays current bandwidth usage |
ifup/ifdown |
used to enable or disable interfaces |
iwconfig |
used to configure wireless interfaces |
netstat |
to check network connections |
nload |
used as bandwidth monitoring tool |
nmap |
used for security audits |
nslookup |
used also for DNS quesry |
ping |
used to check reachability |
route |
displays IP Routing Table |
scp |
secured file transfer |
sftp |
secured file transfer |
ss |
gives details about the sockets |
ssh |
used for secure connections |
tshark |
analyzing and capturing |
tcpdump |
used for analyzing and capturing |
telnet |
used for classical unsecure connnection |
tracepath |
used for path tracking |
traceroute |
used for path tracking |
w |
used to check the current system activity |
wget |
used to download the content of the web servers |
whois |
checks the whois database and return with IP and Domain infor |
yum search keyword |
compresses abc file using gzip. |
yum info abc |
displays description and summary info about abc package |
rpm -i abc.rpm |
installs packag from local file named abc.rpm |
yum remove abc |
Remove/uninstall abc package |
yum list installedl |
lists all installed packages with yum |
yum search [keyword] |
finds a package by a related |
yum info [package_name] |
shows package information and summary |
yum install [package_name.rpm] |
installs a package using the YUM package manager |
dnf install [package_name.rpm] |
installs a package using the DNF package manager |
apt-get install [package_name] |
insalls a package using the APT package manager |
rpm -i [package_name.rpm] |
installs an .rpm package from a local file |
rpm -e [package_name.rpm] |
removes an .rpm package |