shell frequently use commands

  • General
    1. apropos command
    2. Locate commands by keyword lookup.

    3. exit
    4. Terminate your current session, or shell.

    5. man command
    6. Display the Unix manual page describing a given Unix command.

  • File System Navigation

    Return to your home directory.

    cd directory
    Change directory to make directory your current directory.

    file files
    Determine file type.

    List the contents of the current directory.

    ls names
    List the contents of the directories; names can name files and/or directories:

    ls -l
    . . . in a long format, showing permissions, owner, size, and other file info.

    ls -a
    . . . all files, including “hidden” files (file names that begin with a dot “.”).

    ls -R
    . . . Recursively, for all subdirectories.

    ls -t
    . . . in time order (when modified, newest to oldest) rather than in name order.

    Display the name of the current directory, or “print working directory.”

  • File/Directory Manipulation

    compress files
    Reduces the size of a file.

    uncompress files
    Restores compressed files to their original form.

    cp file1 file2
    Copy file(s).

    cp files directory
    Copy file(s) into a directory.

    cp -r dir1 dir2
    Copy a directory and, recursively, its subdirectories.

    mkdir directory
    Create, or “make” a directory.

    mv file1 file2
    Move a file or, if file1 and file2 are in the same directory, rename a file.

    mv files directory
    Move files into a directory.

    mv dir1 dir2
    If directory dir2 exists, move dir1 into dir2; otherwise, rename dir1 as dir2.

    rm files
    Remove (erase) file(s).

    rm -r names
    Remove files, directories, and recursively, any subdirectories.

    rmdir directory
    Remove directory (directory must be empty).

  • Data Manipulation

    cat files
    Concatenate file(s); you can use cat to display the contents of a file (this is not advisable if the file is a binary file).

    grep “pattern” files
    Display all lines in the files that match a pattern.

    more files
    Display contents of files one screen at a time.

    sort files
    Order the lines in a file or files alphabetically (this command does not alter the file or files — it merely displays the sorted output to the screen):

    sort -r files
    . . . in reverse order.

    sort -n files
    . . . numerically (puts 2 before 10 instead of after).

  • Networking/Communications

    ssh hostname
    Connect to a remote host using Secure Shell.

  • Miscellaneous

    Repeat last shell command.

    Repeat last shell command that began with string (for example, type “!m” to repeat the last command that began with “m”).

    Display a calendar of the current month.

    cal month year
    Display a calendar of the given month and year. Note that the year must be fully qualified, for example, “2003” and not “03.”

    Clears terminal screen.

    Display the current local date and time.

    Display a list of users currently logged in.


Fill in your details below or click an icon to log in:

వర్డ్‌ప్రెస్.కామ్ లోగో

You are commenting using your account. నిష్క్రమించు /  మార్చు )

గూగుల్ చిత్రం

You are commenting using your Google account. నిష్క్రమించు /  మార్చు )

ట్విటర్ చిత్రం

You are commenting using your Twitter account. నిష్క్రమించు /  మార్చు )

ఫేస్‌బుక్ చిత్రం

You are commenting using your Facebook account. నిష్క్రమించు /  మార్చు )

Connecting to %s

స్పామును తగ్గించడానికి ఈ సైటు అకిస్మెట్‌ను వాడుతుంది. మీ వ్యాఖ్యల డేటా ఎలా ప్రాసెస్ చేయబడుతుందో తెలుసుకోండి.