How to use them?
ls
: To list directories and files in the current directory, simply typels
and press Enter. You can also specify a directory as an argument to list its contents.pwd
: Typingpwd
and pressing Enter will display the current working directory.cd
: To navigate through directories, usecd
followed by the directory path you want to move to. For example,cd /path/to/directory
will change the current directory to the specified path.mkdir
: Usemkdir
followed by the name of the directory you want to create. For example,mkdir new_directory
will create a directory named “new_directory” in the current location.mv
: To move or rename files and directories, usemv
followed by the source file/directory and the destination. For moving, you can specify the destination directory. For renaming, you can provide the new name for the file or directory.cp
: To copy files and directories, usecp
followed by the source file/directory and the destination. Specify the destination directory to copy to a different location.rm
: To delete files and directories, userm
followed by the file(s) or directory you want to delete. Be cautious with this command as it permanently deletes the specified files or directories.touch
: To create an empty file, typetouch
followed by the filename. If the file already exists,touch
will update its access timestamp.ln
: Useln
to create symbolic links (shortcuts) to other files or directories. Provide the target file/directory as the first argument and the name of the link as the second argument.cat
: To display the contents of a file, usecat
followed by the file name. For example,cat myfile.txt
will print the contents of “myfile.txt” to the terminal.clear
: Typingclear
and pressing Enter will clear the terminal screen, providing a fresh blank slate.echo
: To print text to the terminal, typeecho
followed by the text you want to display. For example,echo "Hello, World!"
will print “Hello, World!” to the terminal.less
: Useless
to display file contents one page at a time. For example,less myfile.txt
will open “myfile.txt” in a pager where you can scroll through the content.man
: To access manual pages for Linux commands, typeman
followed by the command you want to learn more about. For example,man ls
will display the manual page for the “ls” command.uname
: Typinguname
and pressing Enter will print system information, including the operating system name.whoami
: Typingwhoami
and pressing Enter will display the current user’s username.tar
: To extract or compress files, usetar
followed by the appropriate options and file names. For example,tar -xvf archive.tar
will extract the files from “archive.tar”.grep
: To search for a specific pattern in files or outputs, usegrep
followed by the pattern and the file(s) to search. For example,grep "keyword" myfile.txt
will search for the “keyword” in “myfile.txt”.head
: Usehead
followed by the file name to display the first few lines of a file. By default, it shows the first 10 lines, but you can specifytail
: Usetail
followed by the file name to display the specified number of lines from the bottom of the file. For example,tail -n 5 myfile.txt
will show the last 5 lines of “myfile.txt”.