-
Notifications
You must be signed in to change notification settings - Fork 1
/
Getting_familiar_with_linux.txt
28 lines (13 loc) · 1.68 KB
/
Getting_familiar_with_linux.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Some of the mentioned command will help you getting familiar to Linux and hence bash or shell scripting
1. pwd -->
When you first open the terminal, you are in the home directory of your user. To know which directory you are in, you can use the "pwd" command. It gives us the absolute path, which means the path that starts from the root. The root is the base of the Linux file system. It is denoted by a forward slash( / ). The user directory is usually something like "/home/username".
2. ls -->
Use the "ls" command to know what files are in the directory you are in. You can see all the hidden files by using the command "ls -a".
3. cd -->
Use the "cd" command to go to a directory. For example, if you are in the home folder, and you want to go to the downloads folder, then you can type in "cd Downloads". Remember, this command is case sensitive, and you have to type in the name of the folder exactly as it is.
4. mkdir & rmdir -->
Use the mkdir command when you need to create a folder or a directory. For example, if you want to make a directory called “Playâ€, then you can type "mkdir Play". Remember, as told before, if you want to create a directory named "Play GO", then you can type "mkdir Play\ GOâ". Use rmdir to delete a directory. But rmdir can only be used to delete an empty directory. To delete a directory containing files, use rm.
5. rm -->
Use the rm command to delete files and directories. Use "rm -r" to delete just the directory. It deletes both the folder and the files it contains when using only the rm command.
6. touch -->
The touch command is used to create a file. It can be anything, from an empty txt file to an empty zip file. For example, "touch new.txt".