a-z bash commands

Upload: swathirohith

Post on 04-Jun-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 A-Z Bash Commands

    1/5

    An A-Z Index of the Bash command line for Linux.

    alias Create an alias apropos Search Help manual pages (man -k) apt-get Search for and install software packages (Debian/Ubuntu) aptitudeSearch for and install software packages (Debian/Ubuntu) aspell Spell Checker awk ind and !eplace te"t# database sort/$alidate/inde"

    bbasenameStrip director% and suffi" from filenames bash &'U ourne-gain SHellbc rbitrar% precision calculator languagebg Send to backgroundbreak *"it from a loop builtin !un a shell builtinb+ip, Compress or decompress named file(s)c cal Displa% a calendar case Conditionall% perform a command cat Concatenate and print (displa%) the content of files cd Change Director% cfdisk artition table manipulator for .inu" chgrp Change group ownership chmod Change access permissions chown Change file owner and group chroot !un a command with a different root director% chkconfigS%stem ser$ices (runle$el) cksum rint C!C checksum and b%te counts clear Clear terminal screen

    cmp Compare two files comm Compare two sorted files line b% line command !un a command - ignoring shell functions continue!esume the ne"t iteration of a loop cp Cop% one or more files to another location cron Daemon to e"ecute scheduled commands crontab Schedule a command to run at a later time csplit Split a file into conte"t-determined pieces cut Di$ide a file into se$eral partsd date Displa% or change the date time

    dc Desk Calculator dd Con$ert and cop% a file# write disk headers# boot records ddrescueData reco$er% tool declare Declare $ariables and gi$e them attributes df Displa% free disk space diff Displa% the differences between two files diff0 Show differences among three files dig D'S lookup dir riefl% list director% contents dircolorsColour setup for 1ls2 dirname Con$ert a full pathname to 3ust a path

    dirs Displa% list of remembered directories dmesg rint kernel dri$er messagesdu *stimate file space usage

    e echo Displa% message on screen

    http://ss64.com/bash/alias.htmlhttp://ss64.com/bash/apt-get.htmlhttp://ss64.com/bash/apt-get.htmlhttp://ss64.com/bash/aptitude.htmlhttp://ss64.com/bash/aspell.htmlhttp://ss64.com/bash/awk.htmlhttp://ss64.com/bash/basename.htmlhttp://ss64.com/bash/basename.htmlhttp://ss64.com/bash/bc.htmlhttp://ss64.com/bash/bg.htmlhttp://ss64.com/bash/break.htmlhttp://ss64.com/bash/builtin.htmlhttp://www.bzip.org/http://ss64.com/bash/cal.htmlhttp://ss64.com/bash/case.htmlhttp://ss64.com/bash/cat.htmlhttp://ss64.com/bash/cd.htmlhttp://ss64.com/bash/cfdisk.htmlhttp://ss64.com/bash/chgrp.htmlhttp://ss64.com/bash/chmod.htmlhttp://ss64.com/bash/chown.htmlhttp://ss64.com/bash/chroot.htmlhttp://ss64.com/bash/chkconfig.htmlhttp://ss64.com/bash/cksum.htmlhttp://ss64.com/bash/cmp.htmlhttp://ss64.com/bash/comm.htmlhttp://ss64.com/bash/command.htmlhttp://ss64.com/bash/command.htmlhttp://ss64.com/bash/continue.htmlhttp://ss64.com/bash/continue.htmlhttp://ss64.com/bash/cp.htmlhttp://ss64.com/bash/cron.htmlhttp://ss64.com/bash/crontab.htmlhttp://ss64.com/bash/csplit.htmlhttp://ss64.com/bash/cut.htmlhttp://ss64.com/bash/date.htmlhttp://ss64.com/bash/dc.htmlhttp://ss64.com/bash/dd.htmlhttp://ss64.com/bash/ddrescue.htmlhttp://ss64.com/bash/declare.htmlhttp://ss64.com/bash/df.htmlhttp://ss64.com/bash/diff.htmlhttp://ss64.com/bash/diff3.htmlhttp://ss64.com/bash/dig.htmlhttp://ss64.com/bash/dir.htmlhttp://ss64.com/bash/dircolors.htmlhttp://ss64.com/bash/dirname.htmlhttp://ss64.com/bash/dirname.htmlhttp://ss64.com/bash/dirs.htmlhttp://ss64.com/bash/dmesg.htmlhttp://ss64.com/bash/du.htmlhttp://ss64.com/bash/echo.htmlhttp://ss64.com/bash/apt-get.htmlhttp://ss64.com/bash/aptitude.htmlhttp://ss64.com/bash/aspell.htmlhttp://ss64.com/bash/awk.htmlhttp://ss64.com/bash/basename.htmlhttp://ss64.com/bash/bc.htmlhttp://ss64.com/bash/bg.htmlhttp://ss64.com/bash/break.htmlhttp://ss64.com/bash/builtin.htmlhttp://www.bzip.org/http://ss64.com/bash/cal.htmlhttp://ss64.com/bash/case.htmlhttp://ss64.com/bash/cat.htmlhttp://ss64.com/bash/cd.htmlhttp://ss64.com/bash/cfdisk.htmlhttp://ss64.com/bash/chgrp.htmlhttp://ss64.com/bash/chmod.htmlhttp://ss64.com/bash/chown.htmlhttp://ss64.com/bash/chroot.htmlhttp://ss64.com/bash/chkconfig.htmlhttp://ss64.com/bash/cksum.htmlhttp://ss64.com/bash/cmp.htmlhttp://ss64.com/bash/comm.htmlhttp://ss64.com/bash/command.htmlhttp://ss64.com/bash/continue.htmlhttp://ss64.com/bash/cp.htmlhttp://ss64.com/bash/cron.htmlhttp://ss64.com/bash/crontab.htmlhttp://ss64.com/bash/csplit.htmlhttp://ss64.com/bash/cut.htmlhttp://ss64.com/bash/date.htmlhttp://ss64.com/bash/dc.htmlhttp://ss64.com/bash/dd.htmlhttp://ss64.com/bash/ddrescue.htmlhttp://ss64.com/bash/declare.htmlhttp://ss64.com/bash/df.htmlhttp://ss64.com/bash/diff.htmlhttp://ss64.com/bash/diff3.htmlhttp://ss64.com/bash/dig.htmlhttp://ss64.com/bash/dir.htmlhttp://ss64.com/bash/dircolors.htmlhttp://ss64.com/bash/dirname.htmlhttp://ss64.com/bash/dirs.htmlhttp://ss64.com/bash/dmesg.htmlhttp://ss64.com/bash/du.htmlhttp://ss64.com/bash/echo.htmlhttp://ss64.com/bash/alias.html
  • 8/13/2019 A-Z Bash Commands

    2/5

    egrep Search file(s) for lines that match an e"tended e"pression e3ect *3ect remo$able media enable *nable and disable builtin shell commands en$ *n$ironment $ariables ethtool *thernet card settings e$al *$aluate se$eral commands/arguments e"ec *"ecute a command e"it *"it the shell e"pect utomate arbitrar% applications accessed o$er a terminal e"pand Con$ert tabs to spaces e"port Set an en$ironment $ariable e"pr *$aluate e"pressionsf false Do nothing# unsuccessfull% fdformat.ow-le$el format a flopp% disk fdisk artition table manipulator for .inu" fg Send 3ob to foregroundfgrep Search file(s) for lines that match a fi"ed string

    file Determine file t%pe find Search for files that meet a desired criteria fmt !eformat paragraph te"t fold 4rap te"t to fit a specified width5 for *"pand words# and e"ecute commands format ormat disks or tapes free Displa% memor% usage fsck ile s%stem consistenc% check and repair ftp ile 6ransfer rotocol functionDefine unction 7acros fuser 8dentif%/kill the process that is accessing a file

    g gawk ind and !eplace te"t within file(s) getopts arse positional parameters grep Search file(s) for lines that match a gi$en pattern groupadddd a user securit% group groupdelDelete a group groupmod7odif% a group groups rint group names a user is in g+ip Compress or decompress named file(s)h hash !emember the full pathname of a name argument

    head 9utput the first part of file(s) help Displa% help for a built-in command histor% Command Histor% hostnamerint or set s%stem namei icon$ Con$ert the character set of a file id rint user and group id2s if Conditionall% perform a command ifconfigConfigure a network interface ifdown Stop a network interfaceifup Start a network interface up

    import Capture an : ser$er screen and sa$e the image to file install Cop% files and set attributes

    33obs .ist acti$e 3obs

    http://ss64.com/bash/egrep.htmlhttp://ss64.com/bash/eject.htmlhttp://ss64.com/bash/enable.htmlhttp://ss64.com/bash/enable.htmlhttp://ss64.com/bash/env.htmlhttp://ss64.com/bash/eval.htmlhttp://ss64.com/bash/exec.htmlhttp://ss64.com/bash/exit.htmlhttp://en.wikipedia.org/wiki/Expecthttp://en.wikipedia.org/wiki/Expecthttp://ss64.com/bash/expand.htmlhttp://ss64.com/bash/export.htmlhttp://ss64.com/bash/expr.htmlhttp://ss64.com/bash/false.htmlhttp://ss64.com/bash/fdformat.htmlhttp://ss64.com/bash/fdisk.htmlhttp://ss64.com/bash/fg.htmlhttp://ss64.com/bash/fgrep.htmlhttp://ss64.com/bash/find.htmlhttp://ss64.com/bash/fmt.htmlhttp://ss64.com/bash/fold.htmlhttp://ss64.com/bash/for.htmlhttp://ss64.com/bash/fsck.htmlhttp://ss64.com/bash/function.htmlhttp://ss64.com/bash/fuser.htmlhttp://ss64.com/bash/awk.htmlhttp://ss64.com/bash/getopts.htmlhttp://ss64.com/bash/grep.htmlhttp://ss64.com/bash/groupadd.htmlhttp://ss64.com/bash/groupdel.htmlhttp://ss64.com/bash/groupmod.htmlhttp://ss64.com/bash/groups.htmlhttp://ss64.com/bash/gzip.htmlhttp://ss64.com/bash/hash.htmlhttp://ss64.com/bash/head.htmlhttp://ss64.com/bash/history.htmlhttp://ss64.com/bash/hostname.htmlhttp://ss64.com/bash/iconv.htmlhttp://ss64.com/bash/id.htmlhttp://ss64.com/bash/if.htmlhttp://ss64.com/bash/ifconfig.htmlhttp://ss64.com/bash/ifup.htmlhttp://ss64.com/bash/ifup.htmlhttp://ss64.com/bash/import.htmlhttp://ss64.com/bash/install.htmlhttp://ss64.com/bash/jobs.htmlhttp://ss64.com/bash/egrep.htmlhttp://ss64.com/bash/eject.htmlhttp://ss64.com/bash/enable.htmlhttp://ss64.com/bash/env.htmlhttp://ss64.com/bash/eval.htmlhttp://ss64.com/bash/exec.htmlhttp://ss64.com/bash/exit.htmlhttp://en.wikipedia.org/wiki/Expecthttp://ss64.com/bash/expand.htmlhttp://ss64.com/bash/export.htmlhttp://ss64.com/bash/expr.htmlhttp://ss64.com/bash/false.htmlhttp://ss64.com/bash/fdformat.htmlhttp://ss64.com/bash/fdisk.htmlhttp://ss64.com/bash/fg.htmlhttp://ss64.com/bash/fgrep.htmlhttp://ss64.com/bash/find.htmlhttp://ss64.com/bash/fmt.htmlhttp://ss64.com/bash/fold.htmlhttp://ss64.com/bash/for.htmlhttp://ss64.com/bash/fsck.htmlhttp://ss64.com/bash/function.htmlhttp://ss64.com/bash/fuser.htmlhttp://ss64.com/bash/awk.htmlhttp://ss64.com/bash/getopts.htmlhttp://ss64.com/bash/grep.htmlhttp://ss64.com/bash/groupadd.htmlhttp://ss64.com/bash/groupdel.htmlhttp://ss64.com/bash/groupmod.htmlhttp://ss64.com/bash/groups.htmlhttp://ss64.com/bash/gzip.htmlhttp://ss64.com/bash/hash.htmlhttp://ss64.com/bash/head.htmlhttp://ss64.com/bash/history.htmlhttp://ss64.com/bash/hostname.htmlhttp://ss64.com/bash/iconv.htmlhttp://ss64.com/bash/id.htmlhttp://ss64.com/bash/if.htmlhttp://ss64.com/bash/ifconfig.htmlhttp://ss64.com/bash/ifup.htmlhttp://ss64.com/bash/ifup.htmlhttp://ss64.com/bash/import.htmlhttp://ss64.com/bash/install.htmlhttp://ss64.com/bash/jobs.html
  • 8/13/2019 A-Z Bash Commands

    3/5

    3oin ;oin lines on a common fieldk kill Stop a process from running killall

  • 8/13/2019 A-Z Bash Commands

    4/5

    ps rocess statuspushd Sa$e and then change the current director%pwd rint 4orking Director%= =uota Displa% disk usage and limits =uotacheckScan a file s%stem for disk usage =uotactlSet disk =uotasr ram ram disk de$ice rcp Cop% files between two machines read !ead a line from standard input readarra% !ead from stdin into an arra% $ariable readonl%7ark $ariables/functions as readonl% reboot !eboot the s%stem rename !ename files renice lter priorit% of running processesrems%nc S%nchroni+e remote files $ia email

    return *"it a shell function

    re$ !e$erse lines of a file rm !emo$e files rmdir !emo$e folder(s) rs%nc !emote file cop% (S%nchroni+e file trees)s screen 7ultiple" terminal# run remote shells $ia ssh scp Secure cop% (remote file cop%) sdiff 7erge two files interacti$el% sed Stream *ditor select ccept ke%board input se= rint numeric se=uences

    set 7anipulate shell $ariables and functions sftp Secure ile 6ransfer rogram shift Shift positional parameters shopt Shell 9ptions shutdownShutdown or restart linu" sleep Dela% for a specified time slocate ind files sort Sort te"t files source !un commands from a file 252 split Split a file into fi"ed-si+e pieces ssh Secure Shell client (remote login program)

    strace 6race s%stem calls and signals su Substitute user identit% sudo *"ecute a command as another user sum rint a checksum for a file suspend Suspend e"ecution of this shell s%mlink 7ake a new name for a file s%nc S%nchroni+e data on disk with memor%t tail 9utput the last part of file tar 6ape !chi$er tee !edirect output to multiple files

    test *$aluate a conditional e"pression time 7easure rogram running time timeout !un a command with a time limit times User and s%stem times

    http://ss64.com/bash/ps.htmlhttp://ss64.com/bash/pushd.htmlhttp://ss64.com/bash/pwd.htmlhttp://ss64.com/bash/quota.htmlhttp://ss64.com/bash/quotacheck.htmlhttp://ss64.com/bash/quotactl.htmlhttp://ss64.com/bash/ram.htmlhttp://ss64.com/bash/rcp.htmlhttp://ss64.com/bash/read.htmlhttp://ss64.com/bash/readonly.htmlhttp://ss64.com/bash/rename.htmlhttp://ss64.com/bash/rename.htmlhttp://ss64.com/bash/return.htmlhttp://ss64.com/bash/rev.htmlhttp://ss64.com/bash/rm.htmlhttp://ss64.com/bash/rmdir.htmlhttp://ss64.com/bash/rsync.htmlhttp://ss64.com/bash/screen.htmlhttp://ss64.com/bash/scp.htmlhttp://ss64.com/bash/sdiff.htmlhttp://ss64.com/bash/sed.htmlhttp://ss64.com/bash/select.htmlhttp://ss64.com/bash/select.htmlhttp://ss64.com/bash/seq.htmlhttp://ss64.com/bash/set.htmlhttp://ss64.com/bash/shift.htmlhttp://ss64.com/bash/shopt.htmlhttp://ss64.com/bash/shutdown.htmlhttp://ss64.com/bash/sleep.htmlhttp://ss64.com/bash/slocate.htmlhttp://ss64.com/bash/slocate.htmlhttp://ss64.com/bash/sort.htmlhttp://ss64.com/bash/source.htmlhttp://ss64.com/bash/source.htmlhttp://ss64.com/bash/split.htmlhttp://ss64.com/bash/ssh.htmlhttp://ss64.com/bash/su.htmlhttp://ss64.com/bash/sudo.htmlhttp://ss64.com/bash/sum.htmlhttp://ss64.com/bash/suspend.htmlhttp://ss64.com/bash/symlink.htmlhttp://ss64.com/bash/sync.htmlhttp://ss64.com/bash/tail.htmlhttp://ss64.com/bash/tar.htmlhttp://ss64.com/bash/tee.htmlhttp://ss64.com/bash/test.htmlhttp://ss64.com/bash/time.htmlhttp://ss64.com/bash/timeout.htmlhttp://ss64.com/bash/times.htmlhttp://ss64.com/bash/ps.htmlhttp://ss64.com/bash/pushd.htmlhttp://ss64.com/bash/pwd.htmlhttp://ss64.com/bash/quota.htmlhttp://ss64.com/bash/quotacheck.htmlhttp://ss64.com/bash/quotactl.htmlhttp://ss64.com/bash/ram.htmlhttp://ss64.com/bash/rcp.htmlhttp://ss64.com/bash/read.htmlhttp://ss64.com/bash/readonly.htmlhttp://ss64.com/bash/rename.htmlhttp://ss64.com/bash/return.htmlhttp://ss64.com/bash/rev.htmlhttp://ss64.com/bash/rm.htmlhttp://ss64.com/bash/rmdir.htmlhttp://ss64.com/bash/rsync.htmlhttp://ss64.com/bash/screen.htmlhttp://ss64.com/bash/scp.htmlhttp://ss64.com/bash/sdiff.htmlhttp://ss64.com/bash/sed.htmlhttp://ss64.com/bash/select.htmlhttp://ss64.com/bash/seq.htmlhttp://ss64.com/bash/set.htmlhttp://ss64.com/bash/shift.htmlhttp://ss64.com/bash/shopt.htmlhttp://ss64.com/bash/shutdown.htmlhttp://ss64.com/bash/sleep.htmlhttp://ss64.com/bash/slocate.htmlhttp://ss64.com/bash/sort.htmlhttp://ss64.com/bash/source.htmlhttp://ss64.com/bash/split.htmlhttp://ss64.com/bash/ssh.htmlhttp://ss64.com/bash/su.htmlhttp://ss64.com/bash/sudo.htmlhttp://ss64.com/bash/sum.htmlhttp://ss64.com/bash/suspend.htmlhttp://ss64.com/bash/symlink.htmlhttp://ss64.com/bash/sync.htmlhttp://ss64.com/bash/tail.htmlhttp://ss64.com/bash/tar.htmlhttp://ss64.com/bash/tee.htmlhttp://ss64.com/bash/test.htmlhttp://ss64.com/bash/time.htmlhttp://ss64.com/bash/timeout.htmlhttp://ss64.com/bash/times.html
  • 8/13/2019 A-Z Bash Commands

    5/5

    touch Change file timestamps top .ist processes running on the s%stem traceroute6race !oute to Host trap !un a command when a signal is set(bourne) tr 6ranslate# s=uee+e# and/or delete characters true Do nothing# successfull% tsort 6opological sort tt% rint filename of terminal on stdin t%pe Describe a command u ulimit .imit user resources umask Users file creation mask umount Unmount a de$ice unalias !emo$e an alias uname rint s%stem information une"pandCon$ert spaces to tabs uni= Uni=uif% files units Con$ert units from one scale to another

    unset !emo$e $ariable or function names unshar Unpack shell archi$e scripts until *"ecute commands (until error) uptime Show uptime useradd Create new user account userdel Delete a user account usermod 7odif% user account users .ist users currentl% logged in uuencode*ncode a binar% fileuudecodeDecode a file created b% uuencode

    $

    $ Berbosel% list director% contents (1ls -l -b2) $dir Berbosel% list director% contents (1ls -l -b2) $i 6e"t *ditor $mstat !eport $irtual memor% statisticsw wait 4ait for a process to complete watch *"ecute/displa% a program periodicall% wc rint b%te# word# and line counts whereis Search the user2s path# man pages and source files for a program which Search the user2s path for a program file while *"ecute commands

    who rint all usernames currentl% logged in whoami rint the current user id and name (1id -un2) wget !etrie$e web pages or files $ia H66# H66S or 6 write Send a message to another user" "args *"ecute utilit%# passing constructed argument list(s) "dg-open9pen a file or U!. in the user2s preferred application5 %es rint a string until interrupted 5 !un a command script in the current shell !un the last command again EEE Comment / !emark

    Commands marked are bash built-ins# these are a$ailable under all shells5

    http://ss64.com/bash/touch.htmlhttp://ss64.com/bash/top.htmlhttp://ss64.com/bash/traceroute.htmlhttp://ss64.com/bash/tr.htmlhttp://ss64.com/bash/true.htmlhttp://ss64.com/bash/tsort.htmlhttp://ss64.com/bash/tty.htmlhttp://ss64.com/bash/type.htmlhttp://ss64.com/bash/ulimit.htmlhttp://ss64.com/bash/umask.htmlhttp://ss64.com/bash/alias.htmlhttp://ss64.com/bash/uname.htmlhttp://ss64.com/bash/unexpand.htmlhttp://ss64.com/bash/uniq.htmlhttp://ss64.com/bash/units.htmlhttp://ss64.com/bash/unset.htmlhttp://ss64.com/bash/unshar.htmlhttp://ss64.com/bash/until.htmlhttp://ss64.com/bash/useradd.htmlhttp://ss64.com/bash/useradd.htmlhttp://ss64.com/bash/userdel.htmlhttp://ss64.com/bash/usermod.htmlhttp://ss64.com/bash/users.htmlhttp://ss64.com/bash/uuencode.htmlhttp://ss64.com/bash/uuencode.htmlhttp://ss64.com/vi.htmlhttp://ss64.com/bash/vmstat.htmlhttp://ss64.com/bash/wait.htmlhttp://ss64.com/bash/watch.htmlhttp://ss64.com/bash/wc.htmlhttp://ss64.com/bash/whereis.htmlhttp://ss64.com/bash/whereis.htmlhttp://ss64.com/bash/which.htmlhttp://ss64.com/bash/while.htmlhttp://ss64.com/bash/who.htmlhttp://ss64.com/bash/whoami.htmlhttp://ss64.com/bash/write.htmlhttp://ss64.com/bash/xargs.htmlhttp://ss64.com/bash/xdg-open.htmlhttp://ss64.com/bash/yes.htmlhttp://ss64.com/bash/source.htmlhttp://ss64.com/bash/bang.htmlhttp://ss64.com/bash/rem.htmlhttp://ss64.com/bash/touch.htmlhttp://ss64.com/bash/top.htmlhttp://ss64.com/bash/traceroute.htmlhttp://ss64.com/bash/tr.htmlhttp://ss64.com/bash/true.htmlhttp://ss64.com/bash/tsort.htmlhttp://ss64.com/bash/tty.htmlhttp://ss64.com/bash/type.htmlhttp://ss64.com/bash/ulimit.htmlhttp://ss64.com/bash/umask.htmlhttp://ss64.com/bash/alias.htmlhttp://ss64.com/bash/uname.htmlhttp://ss64.com/bash/unexpand.htmlhttp://ss64.com/bash/uniq.htmlhttp://ss64.com/bash/units.htmlhttp://ss64.com/bash/unset.htmlhttp://ss64.com/bash/unshar.htmlhttp://ss64.com/bash/until.htmlhttp://ss64.com/bash/useradd.htmlhttp://ss64.com/bash/userdel.htmlhttp://ss64.com/bash/usermod.htmlhttp://ss64.com/bash/users.htmlhttp://ss64.com/bash/uuencode.htmlhttp://ss64.com/bash/uuencode.htmlhttp://ss64.com/vi.htmlhttp://ss64.com/bash/vmstat.htmlhttp://ss64.com/bash/wait.htmlhttp://ss64.com/bash/watch.htmlhttp://ss64.com/bash/wc.htmlhttp://ss64.com/bash/whereis.htmlhttp://ss64.com/bash/which.htmlhttp://ss64.com/bash/while.htmlhttp://ss64.com/bash/who.htmlhttp://ss64.com/bash/whoami.htmlhttp://ss64.com/bash/write.htmlhttp://ss64.com/bash/xargs.htmlhttp://ss64.com/bash/xdg-open.htmlhttp://ss64.com/bash/yes.htmlhttp://ss64.com/bash/source.htmlhttp://ss64.com/bash/bang.htmlhttp://ss64.com/bash/rem.html