You are on page 1of 4

mkdir [OPTION ...

] cd [option] [directory] ping is a simple Vi most popular text editor


DIRECTORY ... cd / -root directory way to send vi [ -| -s ] [-l] [-L] [-R] [ -r [ filename ] ]
If the specified DIRECTORY cd /usr/sbin takes you to network data to, [-S] [-t tag] [-v] [-V]
does not already exist, mkdir that directory from and receive [-x] [-w] [-n ] [-C] [+command | -c
creates it. anywhere network data from, command ] filename
mkdir mydir Absolute path name -cd another computer vi myfile.txt
mkdir -m a=rwx mydir /usr/local/share/man/man2 on a network pico is a simple text editor in the style
all user can read write and Relative cd man2 ping [- of the pine composer.
execute. m for file modes LRUbdfnqrvVaAB]
cd.. parent directory pico [ options ] [ file ]
mkdir -p /home/chope/a/b/c [-c count] [-m pico myfile.txt
-P option instructs cd to use
If parent directory doesnt mark] [-i interval]
exist, it will make it.
the physical directory
[-l preload]
head makes it easy to output the first
structure instead of following part of files.
rmdir [-p] directory [-p pattern] [-s
symbolic links. The -L option head [OPTION]... [FILE]...
The rmdir utility removes the packetsize] [-t ttl]
forces symbolic links to be by default, prints the first 10 lines of
[-w deadline] [-F
directory entry specified by followed. each FILE
each directory argument, flowlabel]
[-I interface] [- head myfile.txt
provided the directory is
ls [OPTION]... [FILE] M hint] [-N first 10 lines
empty head -15 myfile.txt
Lists the contents of a nioption] [-Q tos] [-
rmdir mydir 15 lines
directory. S sndbuf]
ls l long list [-T timestamp head -n 5K myfile.txt
a file descriptor (FD, ls / contents of root option] [-W 5000 lines
less frequently fildes) is an ls */ contents of all timeout] [hop ...] head -c 6M myfile.txt
abstract indicator (handle) subdirectories destination first 6megabytes
used to access a file or other ls ../ contents of parent ping google.com tail outputs the last part,
input/output resource, such directory ping google.com -c tail [OPTION]... [FILE]..
as a pipe or network socket ls *.{htm,php,cgi} files 1
STDIN, 0; STDOUT, 1; contantining these extensions
STDERR, 2
Redirect standard output >
Redirect standard input <
Append standard output >>
ssh (the SSH client) is a cat mytext.txt finger looks up more
program for logging into a Display text files and displays Displays text, one screen at a time.
remote machine and Copy text files into a new information about more [-dlfpcsu] [-num lines] [+/pattern]
executing commands. It is document system users [+linenum] [file ...]
intended to replace rlogin Append the contents of a text finger [-lmsp] [user more +3 myfile.txt
file to the end of another text ...] [user@host ...] contents from line3
ssh [- file, combining them finger -p ch more +/"hope" myfile.txt
1246AaCfgKkMNnqsTtVvXxY cat mytext.txt mytext2.txt displays info about contents from the beginning of string
y] [-b bind_address] [-c cat mytext.txt > newfile.txt user ch hope
cipher_spec] to copy like cp command Displays who is less is a program similar to more, but it
[-D [bind_address:]port] [- cat mytext.txt mytext2.txt > logged on to the has many more features. less does not
e escape_char] [-F configfile] newfile.txt system. have to read the entire input file before
[-I pkcs11] [-i identity_file] cat mytext.txt >> another-
text-file.txt
who [ OPTION ]... starting, so with large input files it
[-L [ FILE ] [ am i ] starts up faster than text editors like vi
[bind_address:]port:host:host Append cat mytext.txt
mytext2.txt >> another-text- who less [-
port] who am i [+]aABcCdeEfFgGiIJKLmMnNqQrRsSuU
[-l login_name] [-m file.txt
mac_spec] [-O ctl_cmd] [-o cat Output the contents of whoami prints VwWX~] [-b space] [-h lines]
the effective user [-j line] [-k keyfile] [-{oO} logfile] [-p
option] [-p port] a file.
ID. pattern] [-P prompt]
[-R tac (which is "cat" whoami [OPTION] [-t tag] [-T tagsfile] [-x tab,...] [-y
[bind_address:]port:host:host backwards) concatenates whoami lines] [-[z] lines]
port] [-S ctl_path] [-W each FILE to standard output [-# shift] [+[+]cmd] [--] [filename]
host:port] just like the cat command,
whois searches
less file.txt
[-w but in reverse: line-by-line, for an object in a
less -N file.txt
local_tun[:remote_tun]] printing the last line first. This WHOIS database.
views file beginning at line N
[user@]hostname is useful (for instance) for whois [ -h HOST ] [
[command] -p PORT ] [ wc prints newline, word, and byte
examining a chronological log counts for each FILE,
-aCFHlLMmrRSVx ]
slogin shell.website.com file in which the last line of [ -g SOURCE:FIRST- wc [OPTION]... [FILE]...
the file contains the most LAST ] wc myfile.txt
rlogin starts a terminal recent information. [ -i ATTR ] [ -S sample output : 5 13 57 myfile.txt
session on the remote host tac [OPTION] ... [FILE] SOURCE ] [ -T TYPE lines/words/chars
host. tac file1.txt ] object
rlogin [-8EKLdx] [-e char] [-l whois
username] host example.com
rlogin -l hope domain.com
Login as user hope to the
remote system domain.com

tee duplicates its input, The rm command Using alias, frequently-used


A pipe is a form of routing it to multiple outputs removes (deletes) commands can be invoked using a
redirection that is used in at once. files or directories. different, preferred term
Linux and other Unix-like tee [OPTION]... [FILE]... By default, it does alias [name=['command']]
operating systems to send ls -1 *.txt | wc -l | tee not remove alias ll='ls -la'
the output of one program to count.txt directories; ls comp*
another program for further man is the system's manual If the -r (-- Listing files using the ls command in a
processing. viewer; recursive) option is Linux variant or Unix variant that begin
command_1 | command_2 [| Each argument given to specified, with comp.
command_3 . . . ] man is normally the name however, rm will rm c?mp
ls -al | less remove any Deleting files using the rm command in
of a program, utility or
function. matching a Linux or Unix variant that contain c,
ln creates links between directories and mp, and any character in-between.
man man
files. View the manual page for the their contents. ls [sv]*
rm [OPTION]... list files beginning with s or v
ln creates hard links by man command.
FILE... The command name chmod stands
default, or symbolic info reads documentation in rm myfile.txt
the info format for "change mode", and it is used to
links if the -s (--symbolic)
info [OPTION]... [MENU- define the way a file can be accessed.
option is specified. ITEM...]
mv renames file chmod options permissions filename
ln -s file1.txt file2.txt SOURCE to DEST, chmod u=rwx,g=rx,o=r myfile
info emacs
or moves the chmod 754 myfile
The whatis command SOURCE file (or Here the digits 7, 5, and 4 each
provides very brief files) to individually represent the permissions
descriptions of command line DIRECTORY. for the user, group, and others, in that
programs mv [OPTION]... [-T] order. Each digit is a combination of the
ln file1.txt file2.txt whatis head SOURCE DEST numbers 4, 2, 1, and 0:
whatis head tail mv myfile.txt 4 stands for "read",
help destination- 2 stands for "write",
Display information about directory 1 stands for "execute", and
builtin commands. The cp command 0 stands for "no permission."
help [-dms] [PATTERN ...] is used to make So 7 is the combination of permissions
help echo copies of files and 4+2+1 (read, write, and execute), 5 is
The touch command Each manual page has a directories. 4+0+1 (read, no write, and execute),
updates the access and short description included cp [OPTION]... [-T] and 4 is 4+0+0 (read, no write, and no
modification times of each with it. apropos searches SOURCE DEST execute).
FILE to the current system these descriptions for cp origfile newfile
time instances of keyword.
The zip program
touch [OPTION]... FILE... apropos [-dalhvV] [-e|-w|-r] [-
is used to package
touch file.txt s list] [-m system[,...]] [-M
and compress files.
path] zip options archive
[-L locale] [-C file] inpath inpath
keyword ... zip stuff *
apropos find

To compress The tar program is used to The passwd The chown command changes the
gzip filename create, maintain, modify, and command is used owner and owning group of files.
to decompress extract files that are archived to change the chown [OPTION]... [OWNER][:[GROUP]]
gzip -d filename.gz in the tar format password of a user FILE...
to compress and keep tar [-] A --catenate account chown chope file.txt
original file --concatenate | c --create | d passwd [OPTION] Set the owner of file file.txt to user
gzip -k filename --diff --compare | [USER] chope.
uncompress thegzipped file --delete | r --append | t passwd sally a new file's permissions may be
gunzip backup.tar.gz --list | --test-label | u --update restricted in a specific way by applying
uz - gunzips and extracts a | a permissions "mask" called the
gzip'd tar'd archive x --extract --get [options] umask. The umask command is used
[pathname ...] to set this mask, or to show you its
tar -xf archive.tar current value.
umask [-S] [mask]
umask a+r umask a-x umask 777
find searches for files in a useradd is a low-level SGID is defined Sticky bits are mainly set on
directory hierarchy. utility for adding users to a as giving directories.
find [-H] [-L] [-P] [-D system. temporary If the sticky bit is set for a directory,
debugopts] [-Olevel] [path...] useradd [options] LOGIN permissions to a only the owner of that directory or the
[expression] useradd -D user to run a owner of a file can delete or rename a
find . /home/jeff /home/stacy useradd newperson program/file with file within that directory.
find . -name 'apple' the permissions of Encrypt a file with a password
The userdel command the file group Mcrypt is a replacement of crypt in old
deletes a user account and all permissions to unix
associated files. become member mcrypt file1
userdel [options] LOGIN of that group to decrypt the fiel
userdel -r username execute the file mcrypt -d file1.nc
chmod g+s mcrypt -d or mdecrypt
file1.txt
chmod 2750
file1.txt
Changes group ownership of a file or files. SUID can be set in two ways
chgrp [OPTION]... GROUP FILE... 1) Symbolic way (s, Stands for Set)
chgrp hope file.txt 2) Numerical/octal way (4)
Change the owning group of the file file.txt to the group chmod u+s file1.txt
named hope. chmod 4750 file1.txt

You might also like