Let's learn some basic linux commands
-
ls - List all the folder contents
Example: ls -la List all hidden files and directories
-
pwd - Print name of current/working directory
Know your working directory location or path
-
cd - Enter into or exit from the directory
Syntax: cd destination_path
Example: cd /home/user Enter into a home user location
-
mkdir - Create a directory
Syntax: mkdir directory_name
Example: mkdir test Create a new directory named test
-
rm - Remove a file or directory
Syntax: rm filename
Example: rm myfile Remove a file called myfile
Example: rm -r myfolder Remove a folder called myfolder
-
mv - Move/Rename a file or folder
Syntax: mv source_filename destination_filename
Example: mv file1 file2 Move or rename a file1 to file2
-
cp - Copy files and directories
Syntax: cp source_filename destination_filename
Example: cp file1 file2 Copy all contents from a file1 to file2
-
cat - Display file contents
Syntax: cat filename
Example: cat file1 Show all the contents inside the file1 in standared output device(usually your monitor).
-
su - Switch user account
Syntax: su - username
Example: su - linuxer logged into linuxer user account.
-
touch - Create an empty file with the specified name.
Syntax: touch filename
Example: touch file1 Create an empty file called file1.