Linux Commands
Linux Commands
uptime
Displays how long the system has been running including load
average
finger
username Displays information about the user
cat /proc/meminfo
Displays more information about hardware memory
e.g. Total and Free memory
lshw
Displays information about system's hardware
configuration
free -m
Displays free and used memory in the system (-m
flag indicates memory in MB)
hdparm -tT
/dev/xda <:code> Conducts a read speed test on device xda
groupadd
"admin" Adds the group 'admin'
4. File Commands
ls -al
Lists files - both regular & hidden files
and their permissions as well.
cp -r dir1 dir2
Recursively Copies dir1 to dir2. dir2 is
created if it does not exist
ln -s /path/to/file_name
link_name Creates a symbolic link to file_name
Wc
Prints the number of bytes, words and
lines in a file
Example
chmod 766 /data/test.c Sets rwx for owner, rw for group and everyone
chown owner-user:owner-
group file_name Change owner and group owner of the file
chown owner-user:owner-
group directory Change owner and group owner of the directory
7. Network Commands
ip addr show
Displays IP addresses and all the network
interfaces
ping host
ping command sends an ICMP echo request
to establish a connection to server / PC
whois domain
Retrieves more information about a domain
name
dig domain
Retrieves DNS information about the
domain
8. Compression/Archives Commands
tar -cf home.tar home<:code>
Creates archive file called 'home.tar' from
file 'home'
tar -zcvf home.tar.gz source- Creates gzipped tar archive file from the
folder source folder
ssh host
Securely connect to the system via SSH
default port 22
du -sh
Displays disk usage in the current directory in a
human-readable format