Skip to main content

Basic Unix Commands

  • ls --- lists files
    ls -l --- lists files in 'long format', I.E. size of the file,  owner of the file, who has the right to look at it or the privileges and last modification information.
    ls -a --- lists all files, including the ones whose filenames begin in a dot
  • more filename --- shows the first part of a file, that much is displayed on one screen. To see more spacebar is returned or can be pressed to quit. /pattern can be used to search for a pattern.
  • emacs filename --- is an editor that allows to create and edit a file.
  • mv filename1 filename2 --- moves a file i.e. gives it a different name, or moves it into a different directory
  • cp filename1 filename2 --- copies a previously existing file.
  • rm filename --- removes a file. The option rm -i, asks for confirmation before actually deleting anything.
  • diff filename1 filename2 --- compares files, and shows where they differ from each other.
  • wc filename --- wc or ‘word count’; counts the number of words  in a file.
  • chmod options filename --- it allows to change the read, write, and execute permissions on  files for users- owner,others or group. chmod o+r filename makes the file readable for everyone, and chmod o-rfilename will make it unreadable for others again.
  • File Compression commands
    • gzip filename --- compresses files. Normally text files are compressed to about half their original size. gzip usually provides the highest compression rate. Gzip produces files with the ending '.gz' appended to the original filename.
    • gunzip filename --- uncompresses files compressed by gzip.
    • gzcat filename --- helps to look at a gzipped file without actually having to gunzip it (same asgunzip -c). ng gzcat filename | lpr helps to print compressed files directly.
  • printing
    • lpr filename --- print. The -P option is used to specify the printer name in case  to use a printer other than default printer.
    • lpq --- check out the printer queue, e.g. to get the number needed for removal, or to see how many other files will be printed before yours will come out
    • lprm jobnumber --- removes something from the printer queue. Job number can be found by using lpq.
    • genscript --- converts plain text files into postscript for printing, and also provides some options for formatting
    • dviselect --- to print only selected pages.
  • mkdir dirname --- make a new directory
  • ls --- Lists the contents of a directory “ls option dirname” lists content of “dirname” directory. If “dirname” is omitted, it lists current directory. Option “–l” gives a more information showing file type, size, owner and modification date of each file.
  • man : Show any UNIX command usages “man command” shows purpose of command, its format, how to specify options and usage examples.
  • ping – Use to check network reachability to a host
  • cd dirname --- change directory. 'cd ..' will gets one level up from current position
  • pwd --- tells the current path.
  • ff --- ‘find files’ helps to find files throughout the system.
  • ff -p --- This can be useful for finding other things on the system, e.g. documentation. Here only beginning name of file is sufficient too find it i.e. full name is not required.
  • grep string filename(s) --- looks for the string in the files. grep has several varieties (grepegrep, andfgrep)
  • finger username --- gives information about the last users, e.g. when they last read their mail and whether they're logged in or not etc.
  • last -1 username --- tells when the user last logged on and off and from where.
  • elm --- allows users to send e-mail messages to people around the world.
  • rlogin hostname --- allows users to connect to a remote host
  • telnet hostname --- allows users to connect to a remote host.
  • ftp hostname --- allows users to download files from a remote host which is set up as an ftp-server.
  • lynx --- allows users to browse the web from an ordinary terminal. Here only text can be seen.
  • whoami --- returns the current username.
  • passwd --- allows the user to change their password.
  • kill PID --- kills (ends) the processes with the given ID. This works only for current user’s processes.
  • date --- shows the current date and time.
  • cal --- shows a calendar of the current month. 

Popular posts from this blog

Ubuntu Linux shortcut keys

General keyboard shortcutsCtrl + A = Select all
Ctrl + C = Copy the highlighted content to clipboard
Ctrl + V = Paste the clipboard content
Ctrl + N = New (Create a new document, not in terminal)
Ctrl + O = Open a document
Ctrl + S = Save the current document
Ctrl + P = Print the current document
Ctrl + W = Close the close document
Ctrl + Q = Quit the current application Keyboard shortcuts for GNOME desktopCtrl + Alt + F1 = Switch to the first virtual terminal
Ctrl + Alt + F2(F3)(F4)(F5)(F6) = Select the different virtual terminals
Ctrl + Alt + F7 = Restore back to the current terminal session with X
Ctrl + Alt + Backspace = Restart GNOME
Alt + Tab = Switch between open programs
Ctrl + Alt + L = Lock the screen.
Alt + F1 = opens the application menu
Alt + F2 = opens the Run Application dialog box.
Alt + F3 = opens the Deskbar Applet
Alt + F4 = closes the current window.
Alt + F5 = unmaximizes the current window.
Alt + F7 = move the current window
Alt + F8 = resizes the current window.
Alt + F9 = minimizes …

Viewing Your IP Address Information

There are several ways you can determine your IP address information: IPCONFIG Start / Run / cmdIPCONFIG /ALLThis opens a command window. One advantage is that you can send the information to a text file (IPCONFIG /ALL > c:\ip.txt)
But sometimes the window shows show much information you need to scroll around to fine it. VIEW STATUS Control Panel / Network Connections / Double click the iconsfor your network (If the network has an icon in the system tray you can also just double click on that icon)Click on the Support tabClick on the Details button