November 15, 2015

Filled Under: , , , , ,

Some of UNIX commands

linux linux commands shell shell commands unix unix commands


Here you go you can find here some basic UNIX commands 


Directories
  • / : “root” directory
  • /usr : directory usr (sub-directory of / "root" directory)
  • mkdir dirname : make a new directory
  • cd : Change current directory to your HOME directory.
  • cd dirname : change directory. 
  • pwd : show the current directory 

Files 

  • ls : lists your files
    ls -l : lists your files in 'long format'.
    ls -a : lists all files, including the ones whose filenames begin in a dot.
  • more filename : shows the first part of a file, just as much as will fit on one screen. Just hit the space bar to see more or q to quit.
  • emacs filename : is an editor that lets you create and edit a file.
  • mv filename1 filename2 : moves a file
  • cp filename1 filename2 : copies a file
  • rm filename : removes a file.
  • diff filename1 filename2 : compares files.
  • wc filename : tells you how many lines, words, and characters there are in a file
  • chmod options filename : lets you change the read, write, and execute permissions on your files.
  • File Compression
    • gzip filename : compresses files.
    • gunzip filename : uncompresses files compressed by gzip.
    • gzcat filename : lets you look at a gzipped file without actually having to gunzip
  • printing
    • lpr filename : print.
    • lpq : check out the printer queue.
    • lprm jobnumber : remove something from the printer queue.

Viewing and editing files

  • cat filename : Dump a file to the screen in ascii.
  • more filename : Progressively dump a file to the screen.
  • less filename : Like more.
  • vi filename : Edit a file using the vi editor.
  • emacs filename : Edit a file using the emacs editor.
  • head filename : Show the first few lines of a file.
  • head -n  filename : Show the first n lines of a file.
  • tail filename : Show the last few lines of a file.
  • tail -n filename : Show the last n lines of a file.

Changing file permissions and attributes


  • chmod 755 file : Changes the permissions of file to be rwx for the owner, and rx for  the group and the world. (7 = rwx = 111 binary. 5 = r-x = 101 binary)
  • chgrp user file : Makes file belong to the group user.
  • chown cliff file : Makes cliff the owner of file.
  • chown -R cliff dir : Makes cliff the owner of dir and everything in its directory tree.

Finding things

  • ff : find files anywhere on the system.
  • grep string filename(s) : looks for the string in the files.

About other people

  • w : tells you who's logged in, and what they're doing.
  • who : tells you who's logged on, and where they're coming from.
  • finger username : gives you lots of information about that user.
  • last -1 username : tells you when the user last logged on and off and from where.
  • talk username : lets you have a conversation with another user
  • write username : lets you exchange one-line messages with another user
  • elm : lets you send e-mail messages to people around the world

About yourself


  • whoami : returns your username.
  • passwd : lets you change your password.
  • ps -u yourusername : lists your processes.
  • kill PID : kills the processes with the ID you gave.
  • quota -v : show what your disk quota is, how much you're using.
  • du filename : shows the disk usage of the files and directories.
  • last yourusername : lists your last logins.

Connecting

  • nn : allows you to read news.
  •  rlogin hostname : lets you connect to a remote host
  • telnet hostname : lets you connect to a remote host.
  • ftp hostname : lets you download files from a remote host.
  • lynx : lets you browse the web from an ordinary terminal.

Miscellaneous tools


  • date : shows the current date and time.
  • cal : shows a calendar of the current month.

I hope this article was helpful and for any suggestions leave a comment bellow


0 commentaires:

Post a Comment

 

Click if you're interested

Copyright © Everything you need to know ™ is a registered trademark.