1. / (Root): The root directory of the entire file system hierarchy exists in it. Only the root user has the right to write under the root directory. /root is the root user’s home directory, which is not the same as “/”.
2. /bin: It contains all Command binaries for all users, e.g., cat, ls, cp. Contains binary executables Linux commands that need to be used, located under this directory.
3. /boot: It is Boot loader files, e.g., kernels, initrd.
4. /dev : Essential device files stored here, e.g., /dev/null.
5. /etc: It has Host-specific system-wide configuration files. Contains configuration files required by all programs along with startup and shutdown shell scripts, which are used to start/stop individual programs. Example: /etc/resolv.conf, /etc/logrotate.conf.
6. /home: Users’ home directories, contains saved files, personal settings, etc.
Example: /home/Barkha, /home/BM
7. /lib : Libraries which are essential for the binaries in /bin/ and /sbin/.
8. /media: Temporary mount directory for removable devices such as CD-ROM. Examples: /media/floppy for floppy drives; /media/cd recorder for CD writer
9. /mnt: Temporarily mounted filesystems where sysadmins can mount filesystems.
10. /opt : Optional application software package which contains add-on applications from individual vendors.
11. /sbin : Like /bin, /sbin contains binary executables. Example: iptables, reboot, fdisk, ifconfig, swapon
12. /srv: Site-specific data is served by this system. Example, /srv/cvs contains CVS related data.
13. /tmp : Temporary files are stored in it. Files under this directory get deleted when the system is rebooted.
14. /usr : Secondary in the hierarchy system for read-only authority in the user data; contains the majority of (multi-)user utilities and applications as well. Contains binaries, libraries, documentation, and source code for second-level programs.
/usr/bin contains binary files for user programs. \
/usr/sbin contains binary files for system administrators.
/usr/lib contains libraries for /usr/bin and /usr/sbin
/usr/local contains user programs that you install from the source.
/usr/src holds the Linux kernel sources, header files, and documentation.
15. /proc : Virtual filesystem providing process and kernel information as files. In Linux, corresponds to a procfs mount.
This is a type of pseudo file system that contains information about the running process. For example the /proc/{pid} directory contains information about the process with that particular PID.
LINUX basic commands and their uses:
1. pwd (print working directory): To know the path of the current directory/folder you’re in. An example of the command is /home/username.
2. cd (change directory): To navigate through various directories, and files, you can use the cd command.
“cd ..” is used to move to the home directory.
“cd” to go straight to the home folder.
“cd.” to move to your previous directory.
3. ls (list): To view the contents of a directory you are in. For example, enter ls /home/username/Barkha to view the content of Barkha.
ls -R function is to list down all the files in the sub-directories as well.
ls -a function is to show the hidden files.
ls -al function is to list down the files and directories with detailed information like size, owner, etc.
4. cat (Concatenate): List down all the content in the file.
cat > filename function is to create a new file.
cat filename | tr a-z A-Z >output.txt to convert a file to upper case or vice versa.
5. cp (copy): The function is to copy the file from the current directory to another directory. For example, cp wallpapers.jpg /home/username/Photos would create a copy of wallpapers.jpg (from your current directory location) into the Photos directory.
6. mv (move): The function is to move files.For example: mv file.txt /home/username/Filefolder.
7. mkdir (make directory): Use mkdir command to make a new directory, if you will type mkdir Photos it will create a directory with the name Photos.
8. rmdir/rm -r (remove directory): To remove/delete an empty directory.
9. rm (remove): To delete a directory with its content altogether.
10. touch: It is used to create a blank new file.
11. locate: Just like the search command in windows, locate command is used to search/locate a file in Linux. The locate -i makes the command case sensitive in case you want to make it like one. Another such command to search in Linux is found, but it is different from locating command as the former one is used to search within a directory while the latter one is used to search in any directory.
12. grep: Search a particular text/word in a particular/all files. For example:grep barkha Cancerian.txt , will search for the word ‘barkha’ in the file.
13. sudo (super user do): This command is used to perform actions like a root user that is why you need to take permission from the root user to use the command.
14. df (disk free) : Used to know the space in the disk and one can type df -m to know the space value in megabytes.
du (disk usage) :To know how much space a particular file or a directory is taking. One can add du -h tp know the value in mega or kilobytes.
15. head: It is used to view the first line of any text file. For example, if you want to show the first five lines only, type head -n 5 filename.ext.
tail: It is used to view the last line of any text file. For example, if you only want to show the last 10 lines, type tail -n filename.ext.
16. Diff (difference): This command is used to compare the content of two files line by line to give output to those lines that do not match.
17. tar (tape archive): A common platform just like a zip file in windows, it is used to archive multiple files together.
18. chmod (change mode): It is used to change the read, write, and execute permissions of different files and directories.
19. chown: It is used to change or transfer the ownership of a file to a specific username.
20. kill: To terminate an unresponsive programme.
21. ping: To check the connectivity status of the user to a server.
22. wget: To download files from the internet. For example: simply type wget followed by the download link.
23. history: To know the history of the command you have entered.
24. man: To know the function of any command, like typing man cat will let you know the use of the cat command.
25. zip & unzip: The zip command is used to compress your files into a zip archive format, while the unzip command is used to extract the zipped files from a zip archive.
26.hostname: To know the name of your host, you can type hostname and you will get the information. Typing hostname -I will display the IP address of your network.
27. useradd and userdel: The command useradd is used to create a new user, while passwd will set up a new password for the particular user account. In the same manner, to remove a user account, just type userdel User Name and the account will be deleted.
-The clear command is used to clean out the terminal.
-The TAB button to auto fill whatever you are typing in the command section.
-Command Ctrl+C is used to stop and terminate the command, while Command Ctrl+Z will simply pause the command.
-If you accidentally freeze your terminal by using Ctrl+S, simply undo this by using the unfreeze command Ctrl+Q. Ctrl+A moves you to the beginning of the line, while Ctrl+E moves you to the end.
-If you want to run multiple commands in one single command usage, you can do it by using the “;” to separate them. For example Command1; Command2; Command3.
Comments
Post a Comment