You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Show current time and date: date
Show calendar: cal
Show particular year's calendar: cal 2021
Show which user currently logged in to the system
who
whoami
Show hosname/name of the pc or system
hostname
Show OS name/Kernel Version/GUI or terminal type
uname
uname -r
runlevel
Show uptime/login details/free memory/ip address info
uptime
lastlog
free -m
ifconfig or ip addr
Show command history/list of command history
Check command history: history
Run 36th command from history list: !36
Delete all commands from history list: history -c
List
Show short list: ls
Show long list: ll
Show long list: ls -l
Show list with hidden files/directory: ls -al
Show files/directory size with himan readable compatability: ls -lh
Show list with inode: ls -i
Show combination of list: ls -ali
Show combination of list: ls -alih
Change Diretory
Go to home directory: cd ~
Go to root partition: cd /
Go to root home directory: cd /root
Go to one step back from the current directory: cd ../
Go to two step back from the current directory: cd ../../
cd [directoryName]
cd [directoryName/dir1/dir2]
Go to the previous directory: cd -
Copy file: cp [fileName] [newFileName]
Copy file in a particular directory: cp file1 /home/dir1/dir2/file2
Copy file from another location to present location: cp /etc/passswd .
Copy a directory: cp -r [present directory name] [new directory name]
Rename a file: mv file1 myFile
move file: mv myFile ./dir1
Remove/Delete file: rm [fileName]
Remove/Delete directory: rm -r [directoryName]
Remove/Delete directory: rm -rf [directoryName]
Remove/Delete directoey, if directory is empty: rmdir [directoryName]
Remove all contents from the present directory: rm -rf *
Delete directory with all sub-directory and files: rm -rv [parent directoryName]
Disk Usage Information
Show disk usage: du
Show disk usage human readable: du -h
Show disk usage human readable and summarize: du -sh
Show disk usage aith all info: du -a
Show disk usage with all: du -ah
Show total disk usage size: du -ch