0% found this document useful (0 votes)
0 views5 pages

Basic Linux Commands

The document provides a comprehensive overview of basic Linux terminal commands, directory structure, text editors, and inode information. It includes commands for file management, navigation, and system configuration, as well as details on using the nano and vi text editors. Additionally, it explains the concept of inodes and their metadata in the Linux filesystem.

Uploaded by

iwantsatyam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views5 pages

Basic Linux Commands

The document provides a comprehensive overview of basic Linux terminal commands, directory structure, text editors, and inode information. It includes commands for file management, navigation, and system configuration, as well as details on using the nano and vi text editors. Additionally, it explains the concept of inodes and their metadata in the Linux filesystem.

Uploaded by

iwantsatyam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

BASIC LINUX TERMINAL COMMANDS

1. # - It is denote super user.


2. $ - It is denote local user.
3. sudo su – To switch local user to super user.
4. ls – It is used to display information about files in the current directory.
5. pwd – Display the current working directory.
6. mkdir - creates a directory .
7. cd – to navigate between different folders.
8. rmdir - Removes empty directories from the directory lists.
9. cp - copy files from one directory to another directory.
10.mv - Rename and replace the files.
11.rm - delete files.
12.uname - To get basic information about the os.
13.locate - Find a file in the database.
14.touch - Create empty files.
15.ln - Creates shortcuts to another files.
16.cat - Display file contents on terminal.
17.clear - Clear terminal .
18. grep- Search for a specific string in an output.
19.whoami - Display the current users name.
20.sort - Sort the file content.
21.cal - View calendar in terminal .
22.ls-a – Show hidden fils.
23. apt install - install command.
24. ls –lt --- to show recent modify file.
25.–ltr --- to show modify file in decreasing order.
26. ls – lh --- human readable format .
27. more filename – to show all files.
28.date+%D:%H – to show date and hour
29.date+%T – to show date and time
LINUX DIRECTORY STRUCTURE
1. / - root folder
2. /bin – binary or executable programs.
3. /etc – system configuration files.
4. /home - Home directory .It is the default current directory.
5. /opt- Optional or third party software.
6. /tmp – Temporary space ,typically cleared on reboot.
7. /usr – user related programs.
8. / var – Log files.
9. /boot – It contains boot related information files and folders .
10./dev – It is a location of the device files .
11./lib – It contains kernel modules and shared library.
12./media - It contains subdirectories where removal media device are
inserted.
13./mnt – It contains temporary mount directories for mounting the file
system .
14./proc – It is virtual and pseudo file system to contains information about
running processes with specific process id or PID.
15./run – It stores volatile runtime data .
16./sbin – binary executable programs for an administrator .
17./srv- It contains server –specific and server related files.
TEXT EDITORS IN LINUX

1. nano editor:

 nano filename.txt – Open or create file .


 ctrl+o – save file(write out) .
 ctrl+x – Exit nano
 ctrl+k – Cut current line
 ctrl+u – Paste
 ctrl +w – serach text
 ctrl+G – shoe help menu

2. vi editor:
 i – insert mode
 Esc – command mode
 : - command line mode
 :w – save file
 :q – Quit
 :wq or ZZ – save and quit
 :q! – force quit without saving
 dd – delete current line
 yy – copy current line
 p – for paste
 u – undo last changes
 I – insert beginning of the line
 Shift+g – To go top to bottom of the page
 gg – to go bottom to top of the page
 / - use to search top to bottom
 ? – use to search bottom to top
 :earlier 10M – To show 10 minutes before file condition
 :%s/old/new/g – replace old value to new value
 :s/old/new/ - replace on current line
 :set number – to show line number
 :set nonumber – hide line number
 :e! – to revert old position of file but mandatory its not be save.
 Shift+P – to paste one line upper.
 Shift+v – to select any word
 Shift +o – to new line
 Shift +i – to use to front of any word of any line
 Shift +a – to use show last word of any line .
 vim filename – to create new file
 Esc+:+syntaxOff – to remove color of vi editor mode
 Esc+:+syntaxOn – to on color of vi editor mode
 vim – o file1 file2 – to work two file in same time .
 ctrl + w press two times – to reach second file and go to first file
press same ctrl +w two times.
 cp file1 file2 – copy file1 into file2
 vim –d file1 file2 – to find two files.

INODE :
 Linux must allocate an index node (inode) for every file and directory
in the filesystem. Inodes do not store actual data. Instead, they store
the metadata where you can find the storage blocks of each file's
data.
 Metadata in an inode:
Filetype , permission ,ownerid ,groupid ,filesize ,timestamp, lasttime access,
Last time modified .(filename,filepath not stored)
 ls-li – to check inode .
 df- i – to check how many inode used.
 Size of inode is 2048 bytes or 2 kilobytes.

You might also like