Topics Map > Computing > linux
Topics Map > Computing > research

Linux General Commands

This is a more generalized listing of different commands used in navigating and manipulating linux environments and programs.

General Commands

These commands are good to keep in mind when doing any sort of work on a UNIX computer.
  • man command : Gives information from the UNIX manual about command. Text is displayed using less(below).
    Also, man -k word will list manual pages whose titles contain the keyword word.
  • Ctrl+C : Usually kills whatever you are doing and signals the shell to accept the next command. Use Ctrl+C only if you are stuck, since work you did during the killed command may be lost.
  • Ctrl+Z : This control code temporarily suspends a command, whereupon the shell can accept the next command. Use the fg (foreground) command to get the suspended process running again; type jobs to see if you have any suspended or background processes. Or use the bg command to have the last suspended job run in the background.
  • crypt input output : Encrypt or decrypt a file (it knows which way to go). It will ask you for a key. The algorithm is not sufficiently strong for national security issues.
  • date :Displays the current date and time.
  • finger name : Looks up the loginID of name. e.g. finger Gilfong will give you the loginID (and full name) of everyone named Gilfong. Be prepared for a lot of output with common names. You can also specify the loginID to find the person's full name.
  • gunzip file :The inverse of gzip: restores the original file.
  • gzip file : Compresses file. The full-size file is removed and the compressed file has the same name with an extension of ".gz" added. You can get 4 to 1 compression on low-entropy data.
  • hostname : Gives the name of the computer on which you are currently working.
  • kill pid : Cancel the process with identification pid
  • pkill process : Cancel the named process - e.g. pkill mybustedscript
  • less : Displays text files one page at a time. Press "h" for help, "q" to quit", SPACE to go to the next page, "b" for previous page, "/" to search, etc.
  • logout : Ends your session.  If you ran multiple shells you may need to run this for each nested process.
  • locate file : gives the location of file based on the contents of a database which is updated nightly
  • nice -prior program : Gives program processing priority value prior (1 being the highest priority level and 19 the lowest) which tells the computer how to process tasks.
    e.g. nice -19 ./a.out & runs the program a.out in the background at the lowest priority.
  • passwd : Changes your password. You will be asked to type the old password first, and then the new password twice. None of this is visible on the screen.
  • command1 | command2 : Called the “pipe” command. Takes the output of command command1 and uses it as the input for command2.
    e.g. ls | less lists files in the current directory and views the results in a paginated form
  • uptime : Shows the load on the computer you are currently using.
  • who : Lists all users on the computer in which you are currently working.
  • whoami : Tells who is currently logged on a specific terminal

Keywordscommands, linux, command line, resources   Doc ID114561
OwnerErik M.GroupUW Math Department
Created2021-10-28 14:28:55Updated2024-05-06 09:46:30
SitesUW Math Department
Feedback  0   0