Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

List of Some Useful Linux Commands

  • Some General commands:

  1. Check your current working directory/location :

    $ pwd

    Screenshot_20250113_161439

  2. To display the name of current logged in user :

    $ whoami

    Screenshot_20250113_161747

  3. To check System date and time :

     $ date

we can customize the result of the date command ,Some examples are following :

 $ date +%D   # used only for getting the date

 $ date +%T   # used only for getting the current time

 $ date +%H:%M   # used only for getting the current time in HH:MM format

 $ date +%h   # used only for getting the first 3 letters of month name

Screenshot_20250113_162019

  1. To display/list files and directories present in current location :

    $ ls

    Screenshot_20250113_162540

    Options for ls command :

    $ ls -lt   #This displays latest modified file on the top and it is long listing format.
    
    $ ls -ltr  #This is opposite for command for lt option and output result will be in reverse order.
    
    $ ls -lh  #This displays the output in human readble and long listing format.


output format for **ls **command will be in following manner :

<File-permission> <No. of hard links> <owner-name> <Group> <Modification-date-and-time> <File-size> <File-Name>
  1. space for short listing format :

  2. To clear current Terminal screen:

    $ clear

  • Commands related to Files and Directories:

  1. To display content of the file on terminal
    $ cat <file-name>

Note: If the file does not have an extension, do not mention it. If the file has an extension, mention the file name along with the extension.

Screenshot_20250113_163311

  1. To create a new file:
       $ touch <new_file_name>
    Screenshot_20250113_163956

Note: File name can have an extension or may not have an extension.

About

This repository contains useful linux commands.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors