Ubuntu(Linux) Commands You MUST KNOW!!

image description

Ubuntu(Linux) Commands You MUST KNOW!!

Basic Commands Of Ubuntu

S.No Command Command Use
1. ls List directory contents.
2. cd Change directory.
3. pwd Print Working Directory.
4. mkdir Make Directory.
5. rm Delete File (use -r flag to delete folder)
6. cp/mv Copy/Move File/Folder
7. touch Creates an empty file.
8. nano/vi Text editors for creating or editing files.
9. cat Concatenate and display files.
10. sudo Execute commands with superuser privileges.

 

 

 

 

 

 

 

 

 

 

 

Excluding these commands that you probably know, 

The first command

you should absolutely know is:

grep

This command is generally used for searching patterns in files. It's a great tool especially when you have to search a single text in a whole folder... You can use this command:

grep -r "your_text_to_find" file/folder

To search in current directory you may use . in the place of file/folder 

Permission Error??

Are you encountering File/Folder Permission Error?

chown

To change the ownership of folder you may use this command in the below format:

sudo chown user:group folder/file 

Replace user with your actual linux user.

 

Chown vs Chmod

Users generally confuse in these two commands: Chown and Chmod. If you also have such confusion you've come to right place...

As we know, chown changes the ownership of directory whereas chmod is used to change the permissions (read, write, execute) of files and directories. It stands for "change mode". For example:

chmod u+r file

 

Resource Stats(Processor, RAM, etc.)

New to linux?? and don't know how to check stats of your system?? Don't take tension.. We are here!

top

It will display stats but in a non-standard manner... but we have solution also

htop 

A beautiful manner to present stats... 

 

What About Storage!?

Use:

df

To Display disk space usage and use:

du

 To Display directory space usage.

 

Can't Read? Use -h flag to display in *human readable syntax*

To Summarize Total Disk Usage Use:

du -sh /path/

 

Am I Missing Any Important Command!?

Comment down... 

Related Posts

You may like these post too

Comments on this post

0 comments

Leave a comment

it’s easy to post a comment

image description
image description