Useful linux command
ls linux Command
ls command display list of files.
Whoami linux Command
whoami command print the name of current user.
who command simply return user name, date, time and host information.
who and w command are similer. Unlike w command who doesn’t print what users are doing.
less command allows quickly view file.
# less main.log
more command allows quickly view file and shows details in percentage.
cat command used to view multiple file at the same time.
# cat file1 file2
cd command is used to change directory.
# cd /directory1
tar command is used to compress files and folders in Linux.
# tar -cvf somename.tar /home
Find command used to search files, strings and directories.
# find / -name
rm linux command
rm command used to remove or delete a file without prompting for confirmation.
# rm filename
mkdir command example.
mkdir command is used to create directories in Linux.
# mkdir directory-name
The clear command is used to clear the terminal screen.
The date command can be used to print (or even set) the system date and time.
The chmod command lets you change access permissions for a file.
#chmod +x filename
The exit command causes the shell to exit.
The gzip command compresses the input file, replacing the file itself with one having a .gz extension.
# gzip filename
The nano command in Linux launches the ‘nano’ editor.
The passwd command is used for changing passwords for user accounts.
# passwd jquerytraining
Changing password for jquerytraining.
(current) UNIX password:
The ping linux command is used to check whether or not a system is up and responding. It sends ICMP ECHO_REQUEST to network hosts.
# ping jquerytraining.com
PING jquerytraining.com (220.127.116.11) with 32 bit of data.
64 bytes from 18.104.22.168: icmp_seq=1 ttl=58 time=47.3 ms
64 bytes from 22.214.171.124: icmp_seq=2 ttl=58 time=51.9 ms
64 bytes from 126.96.36.199: icmp_seq=3 ttl=58 time=57.4 ms
The shutdown linux command lets user shut the system in a safe way.
The sudo command lets a permitted user run a command as another user (usually root or superuser).
# sudo [command]