Basic Linux commands part 1:
1: Current working Directory:
To know which location you are working you have to type "PWD" in the terminal.
2: To list Files and Directories:
To list files and directories in the current working directory you have to type "LS" in terminal.
To list files and directories of different location then you have to type " ls location" in terminal.
Options of "ls" command:
1."ls -i" it will display inode value of files and folders.
2. "ls -l" this command will display files and folders with attributes.
3. "ls -a" this command will display all hidden files and directories.
4."ls -d" this command will display a particular file or folder.
5. "ls -R" this command will show you the tree structure.
3: Creating files:
you can create files in many ways some of them are:
1. cat command:
➤ to create a file using cat you have to type "cat > filename"
➤ to view file using cat you have to type " cat filename"
➤ to add text to a file using cat you have to type " cat >> filename"
2. gedit command
➤ you can easily create files using gedit also it will give you a graphical interface:
3. touch command
➤ with touch command you can create a file but it wont give you a option to edit:
➤ with touch command you can create multiple files as well.
➤ with touch command you can create multiple of sequence numbers:
4. vi command
➤ vi command helps you to create a file and give you edit option you add the data delete the data etc, we will create a separate video and a post how to use vi editor.
5. vim command
➤ vim editor is a advanced version of vi editor.
4: Creating directories or folders:
➤ To create a directory type "mkdir directoryname"
➤ To create multiple directories type " mkdir folder1 folder2 folder3"
➤ To create directory under directory or folder under folder type " mkdir -p folder1/folder2/folder3/folder4"
Post a Comment