Basic Linux Commands
pwd
Get the full path of the current working directory
cd
Navigates to the last directory you were working on
cd ~
Navigates to the current user's home directory
cd ..
Navigates to the parent directory of the current directory
ls
Lists the names of files and directories in the current directory
ls -a
List all the files including the hidden files and directories (hidden files are those whose name starts with . )
ls -l
Lists the files and directories in the current directory in long table format
ls -ld dir-name
List information about the directory dir-name instead of its contents.
mkdir dir-name
Creates a directory with the name dir-name
rmdir dir-name
Removes/Deletes the directory with the name dir-name
Changing File Permissions
Octal | Decimal | Permission | Linux Representation |
000 | 0 (0+0+0) | NO Permission | --- |
001 | 1 (0+0+1) | Execution (NO Read and Write) | --x |
010 | 2 (0+2+0) | Write (NO Read and Execution) | -w- |
011 | 3 (0+2+1) | Write + Execution (NO Read) | -wx |
100 | 4 (4+0+0) | Read (NO Write and Execution) | r-- |
101 | 5 (4+0+1) | Read + Execution (NO Write) | r-x |
110 | 6 (4+2+0) | Read + Write (NO Execution) | rw- |
111 | 7 (4+2+1) | Read + Write+ Execution (All Permissions) | rwx |
chmod file-name
Change the file permissions. Specifications
chmod -R dir-name
Change the permissions of a directory recursively. Mostly used to change the permission of a directory
Did you find this article valuable?
Support Prahlad Inala by becoming a sponsor. Any amount is appreciated!