More Linux Bash Commands

Hello reader,

While we can find most of these by searching directly in the terminal it isn’t always practical to stop a task to search via –help. Often we resort to a browser to quickly find a command so hopefully this ends up a result of that search. *All commands listed below were available in bash 4.3.42 x86_64 as of August 13th 2016.

GNU bash, version 4.3.42(1)-release (x86_64-pc-linux-gnu)
These shell commands are defined internally. Type `help’ to see this list.
Type `help name’ to find out more about the function `name’.
Use `info bash’ to find out more about the shell in general.
Use `man -k’ or `info’ to find out more about commands not in this list.

A star (*) next to a name means that the command is disabled.

job_spec [&] history [-c] [-d offset] [n] or hist>
(( expression )) if COMMANDS; then COMMANDS; [ elif C>
. filename [arguments] jobs [-lnprs] [jobspec …] or jobs >
: kill [-s sigspec | -n signum | -sigs>
[ arg… ] let arg [arg …]
[[ expression ]] local [option] name[=value] …
alias [-p] [name[=value] … ] logout [n]
bg [job_spec …] mapfile [-n count] [-O origin] [-s c>
bind [-lpsvPSVX] [-m keymap] [-f file> popd [-n] [+N | -N]
break [n] printf [-v var] format [arguments]
builtin [shell-builtin [arg …]] pushd [-n] [+N | -N | dir]
caller [expr] pwd [-LP]
case WORD in [PATTERN [| PATTERN]…)> read [-ers] [-a array] [-d delim] [->
cd [-L|[-P [-e]] [-@]] [dir] readarray [-n count] [-O origin] [-s>
command [-pVv] command [arg …] readonly [-aAf] [name[=value] …] o>
compgen [-abcdefgjksuv] [-o option] > return [n]
complete [-abcdefgjksuv] [-pr] [-DE] > select NAME [in WORDS … ;] do COMM>
compopt [-o|+o option] [-DE] [name ..> set [-abefhkmnptuvxBCHP] [-o option->
continue [n] shift [n]
coproc [NAME] command [redirections] shopt [-pqsu] [-o] [optname …]
declare [-aAfFgilnrtux] [-p] [name[=v> source filename [arguments]
dirs [-clpv] [+N] [-N] suspend [-f]
disown [-h] [-ar] [jobspec …] test [expr]
echo [-neE] [arg …] time [-p] pipeline
enable [-a] [-dnps] [-f filename] [na> times
eval [arg …] trap [-lp] [[arg] signal_spec …]
exec [-cl] [-a name] [command [argume> true
exit [n] type [-afptP] name [name …]
export [-fn] [name[=value] …] or ex> typeset [-aAfFgilrtux] [-p] name[=va>
false ulimit [-SHabcdefilmnpqrstuvxT] [lim>
fc [-e ename] [-lnr] [first] [last] o> umask [-p] [-S] [mode]
fg [job_spec] unalias [-a] name [name …]
for NAME [in WORDS … ] ; do COMMAND> unset [-f] [-v] [-n] [name …]
for (( exp1; exp2; exp3 )); do COMMAN> until COMMANDS; do COMMANDS; done
function name { COMMANDS ; } or name > variables – Names and meanings of so>
getopts optstring name [arg] wait [-n] [id …]
hash [-lr] [-p pathname] [-dt] [name > while COMMANDS; do COMMANDS; done
help [-dms] [pattern …] { COMMANDS ; }

Also:

GNU long options:
–debug
–debugger
–dump-po-strings
–dump-strings
–help
–init-file
–login
–noediting
–noprofile
–norc
–posix
–rcfile
–restricted
–verbose
–version
Shell options:
-ilrsD or -c command or -O shopt_option (invocation only)
-abefhkmnptuvxBCHP or -o option
Type `bash -c “help set”‘ for more information about shell options.

Lets not forget sudo options:

sudo – execute a command as another user

usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]
[command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
prompt] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
prompt] [-u user] file …

Options:
-A, –askpass use a helper program for password prompting
-b, –background run command in the background
-C, –close-from=num close all file descriptors >= num
-E, –preserve-env preserve user environment when running command
-e, –edit edit files instead of running a command
-g, –group=group run command as the specified group name or ID
-H, –set-home set HOME variable to target user’s home dir
-h, –help display help message and exit
-h, –host=host run command on host (if supported by plugin)
-i, –login run login shell as the target user; a command may
also be specified
-K, –remove-timestamp remove timestamp file completely
-k, –reset-timestamp invalidate timestamp file
-l, –list list user’s privileges or check a specific
command; use twice for longer format
-n, –non-interactive non-interactive mode, no prompts are used
-P, –preserve-groups preserve group vector instead of setting to
target’s
-p, –prompt=prompt use the specified password prompt
-r, –role=role create SELinux security context with specified
role
-S, –stdin read password from standard input
-s, –shell run shell as the target user; a command may also
be specified
-t, –type=type create SELinux security context with specified
type
-U, –other-user=user in list mode, display privileges for user
-u, –user=user run command (or edit file) as specified user name
or ID
-V, –version display version information and exit
-v, –validate update user’s timestamp without running a command
— stop processing command line arguments

Apt Commands:

apt
Usage: apt command [options]
apt help command [options]

Commands:
add-repository – Add entries to apt sources.list
autoclean – Erase old downloaded archive files
autoremove – Remove automatically all unused packages
build – Build binary or source packages from sources
build-dep – Configure build-dependencies for source packages
changelog – View a package’s changelog
check – Verify that there are no broken dependencies
clean – Erase downloaded archive files
contains – List packages containing a file
content – List files contained in a package
deb – Install a .deb package
depends – Show raw dependency information for a package
dist-upgrade – Upgrade the system by removing/installing/upgrading packages
download – Download the .deb file for a package
edit-sources – Edit /etc/apt/sources.list with your preferred text editor
dselect-upgrade – Follow dselect selections
full-upgrade – Same as ‘dist-upgrade’
held – List all held packages
help – Show help for a command
hold – Hold a package
install – Install/upgrade packages
list – List packages based on package names
policy – Show policy settings
purge – Remove packages and their configuration files
recommends – List missing recommended packages for a particular package
rdepends – Show reverse dependency information for a package
reinstall – Download and (possibly) reinstall a currently installed package
remove – Remove packages
search – Search for a package by name and/or expression
show – Display detailed information about a package
showhold – Same as ‘held’
source – Download source archives
sources – Same as ‘edit-sources’
unhold – Unhold a package
update – Download lists of new/upgradable packages
upgrade – Perform a safe upgrade
version – Show the installed version of a package

Install has it’s own options:

Usage: install [OPTION]… [-T] SOURCE DEST
or: install [OPTION]… SOURCE… DIRECTORY
or: install [OPTION]… -t DIRECTORY SOURCE…
or: install [OPTION]… -d DIRECTORY…

This install program copies files (often just compiled) into destination
locations you choose. If you want to download and install a ready-to-use
package on a GNU/Linux system, you should instead be using a package manager
like yum(1) or apt-get(1).

In the first three forms, copy SOURCE to DEST or multiple SOURCE(s) to
the existing DIRECTORY, while setting permission modes and owner/group.
In the 4th form, create all components of the given DIRECTORY(ies).

Mandatory arguments to long options are mandatory for short options too.
–backup[=CONTROL] make a backup of each existing destination file
-b like –backup but does not accept an argument
-c (ignored)
-C, –compare compare each pair of source and destination files, and
in some cases, do not modify the destination at all
-d, –directory treat all arguments as directory names; create all
components of the specified directories
-D create all leading components of DEST except the last,
or all components of –target-directory,
then copy SOURCE to DEST
-g, –group=GROUP set group ownership, instead of process’ current group
-m, –mode=MODE set permission mode (as in chmod), instead of rwxr-xr-x
-o, –owner=OWNER set ownership (super-user only)
-p, –preserve-timestamps apply access/modification times of SOURCE files
to corresponding destination files
-s, –strip strip symbol tables
–strip-program=PROGRAM program used to strip binaries
-S, –suffix=SUFFIX override the usual backup suffix
-t, –target-directory=DIRECTORY copy all SOURCE arguments into DIRECTORY
-T, –no-target-directory treat DEST as a normal file
-v, –verbose print the name of each directory as it is created
–preserve-context preserve SELinux security context
-Z set SELinux security context of destination
file to default type
–context[=CTX] like -Z, or if CTX is specified then set the
SELinux or SMACK security context to CTX
–help display this help and exit
–version output version information and exit

The backup suffix is ‘~’, unless set with –suffix or SIMPLE_BACKUP_SUFFIX.
The version control method may be selected via the –backup option or through
the VERSION_CONTROL environment variable. Here are the values:

none, off never make backups (even if –backup is given)
numbered, t make numbered backups
existing, nil numbered if numbered backups exist, simple otherwise
simple, never always make simple backups

GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
Full documentation at: <http://www.gnu.org/software/coreutils/install>
or available locally via: info ‘(coreutils) install invocation’

These are from Git 

usage: git [–version] [–help] [-C <path>] [-c name=value]
[–exec-path[=<path>]] [–html-path] [–man-path] [–info-path]
[-p | –paginate | –no-pager] [–no-replace-objects] [–bare]
[–git-dir=<path>] [–work-tree=<path>] [–namespace=<name>]
<command> [<args>]

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
clone Clone a repository into a new directory
init Create an empty Git repository or reinitialize an existing one

work on the current change (see also: git help everyday)
add Add file contents to the index
mv Move or rename a file, a directory, or a symlink
reset Reset current HEAD to the specified state
rm Remove files from the working tree and from the index

examine the history and state (see also: git help revisions)
bisect Use binary search to find the commit that introduced a bug
grep Print lines matching a pattern
log Show commit logs
show Show various types of objects
status Show the working tree status

grow, mark and tweak your common history
branch List, create, or delete branches
checkout Switch branches or restore working tree files
commit Record changes to the repository
diff Show changes between commits, commit and working tree, etc
merge Join two or more development histories together
rebase Forward-port local commits to the updated upstream head
tag Create, list, delete or verify a tag object signed with GPG

collaborate (see also: git help workflows)
fetch Download objects and refs from another repository
pull Fetch from and integrate with another repository or a local branch
push Update remote refs along with associated objects

‘git help -a’ and ‘git help -g’ list available subcommands and some
concept guides. See ‘git help <command>’ or ‘git help <concept>’
to read about a specific subcommand or concept.

Git help -a

usage: git [–version] [–help] [-C <path>] [-c name=value]
[–exec-path[=<path>]] [–html-path] [–man-path] [–info-path]
[-p | –paginate | –no-pager] [–no-replace-objects] [–bare]
[–git-dir=<path>] [–work-tree=<path>] [–namespace=<name>]
<command> [<args>]

available git commands in ‘/usr/lib/git-core’

add merge-ours
add–interactive merge-recursive
am merge-resolve
annotate merge-subtree
apply merge-tree
archive mergetool
bisect mktag
bisect–helper mktree
blame mv
branch name-rev
bundle notes
cat-file pack-objects
check-attr pack-redundant
check-ignore pack-refs
check-mailmap patch-id
check-ref-format prune
checkout prune-packed
checkout-index pull
cherry push
cherry-pick quiltimport
clean read-tree
clone rebase
column receive-pack
commit reflog
commit-tree relink
config remote
count-objects remote-ext
credential remote-fd
credential-cache remote-ftp
credential-cache–daemon remote-ftps
credential-store remote-http
daemon remote-https
describe remote-testsvn
diff repack
diff-files replace
diff-index request-pull
diff-tree rerere
difftool reset
difftool–helper rev-list
fast-export rev-parse
fast-import revert
fetch rm
fetch-pack send-pack
filter-branch sh-i18n–envsubst
fmt-merge-msg shell
for-each-ref shortlog
format-patch show
fsck show-branch
fsck-objects show-index
gc show-ref
get-tar-commit-id stage
grep stash
hash-object status
help stripspace
http-backend submodule
http-fetch submodule–helper
http-push subtree
imap-send symbolic-ref
index-pack tag
init unpack-file
init-db unpack-objects
instaweb update-index
interpret-trailers update-ref
log update-server-info
ls-files upload-archive
ls-remote upload-pack
ls-tree var
mailinfo verify-commit
mailsplit verify-pack
merge verify-tag
merge-base web–browse
merge-file whatchanged
merge-index worktree
merge-octopus write-tree
merge-one-file

‘git help -a’ and ‘git help -g’ list available subcommands and some
concept guides. See ‘git help <command>’ or ‘git help <concept>’
to read about a specific subcommand or concept.

Finally Git help -g

The common Git guides are:

attributes Defining attributes per path
everyday Everyday Git With 20 Commands Or So
glossary A Git glossary
ignore Specifies intentionally untracked files to ignore
modules Defining submodule properties
revisions Specifying revisions and ranges for Git
tutorial A tutorial introduction to Git (for version 1.5.1 or newer)
workflows An overview of recommended workflows with Git

‘git help -a’ and ‘git help -g’ list available subcommands and some
concept guides. See ‘git help <command>’ or ‘git help <concept>’
to read about a specific subcommand or concept.

 

Spread the love

696 thoughts on “More Linux Bash Commands”

  1. I’m not sure exactly why but this weblog is loading very slow for me. Is anyone else having this problem or is it a problem on my end? I’ll check back later on and see if the problem still exists.

  2. Have you ever considered writing an e-book or guest authoring on other sites? I have a blog based on the same topics you discuss and would love to have you share some stories/information. I know my viewers would appreciate your work. If you’re even remotely interested, feel free to shoot me an e-mail.

  3. Hello there! This is my first visit to your blog! We are a team of volunteers and starting a new project in a community in the same niche. Your blog provided us beneficial information to work on. You have done a marvellous job!

  4. Good day! I know this is kinda off topic but I was wondering which blog platform are you using for this website? I’m getting fed up of WordPress because I’ve had issues with hackers and I’m looking at options for another platform. I would be awesome if you could point me in the direction of a good platform.

  5. Hi there! This is kind of off topic but I need some help from an established blog. Is it very hard to set up your own blog? I’m not very techincal but I can figure things out pretty quick. I’m thinking about making my own but I’m not sure where to begin. Do you have any ideas or suggestions? Thank you

  6. Today, I went to the beachfront with my children. I found a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She placed the shell to her ear and screamed. There was a hermit crab inside and it pinched her ear. She never wants to go back! LoL I know this is entirely off topic but I had to tell someone!

  7. Hi I am so grateful I found your web site, I really found you by accident, while I was researching on Askjeeve for something else, Anyhow I am here now and would just like to say cheers for a marvelous post and a all round thrilling blog (I also love the theme/design), I don’t have time to read it all at the minute but I have saved it and also added in your RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the great work.

  8. The other day, while I was at work, my sister stole my apple ipad and tested to see if it can survive a 40 foot drop, just so she can be a youtube sensation. My iPad is now broken and she has 83 views. I know this is entirely off topic but I had to share it with someone!

  9. Hey there would you mind letting me know which webhost you’re using? I’ve loaded your blog in 3 completely different web browsers and I must say this blog loads a lot quicker then most. Can you suggest a good hosting provider at a reasonable price? Thanks, I appreciate it!

  10. Hello! I just wanted to ask if you ever have any issues with hackers? My last blog (wordpress) was hacked and I ended up losing many months of hard work due to no backup. Do you have any methods to stop hackers?

  11. Hey there! I could have sworn I’ve been to this website before but after browsing through some of the post I realized it’s new to me. Nonetheless, I’m definitely glad I found it and I’ll be bookmarking and checking back often!

  12. Please let me know if you’re looking for a article author for your site. You have some really great posts and I think I would be a good asset. If you ever want to take some of the load off, I’d absolutely love to write some articles for your blog in exchange for a link back to mine. Please send me an email if interested. Kudos!

  13. My spouse and I stumbled over here from a different page and thought I might check things out. I like what I see so now i am following you. Look forward to finding out about your web page for a second time.

  14. Hmm it looks like your blog ate my first comment (it was extremely long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog. I as well am an aspiring blog blogger but I’m still new to the whole thing. Do you have any helpful hints for first-time blog writers? I’d genuinely appreciate it.

  15. Hello there! Quick question that’s entirely off topic. Do you know how to make your site mobile friendly? My weblog looks weird when viewing from my iphone. I’m trying to find a template or plugin that might be able to fix this issue. If you have any suggestions, please share. Thank you!

  16. I know this if off topic but I’m looking into starting my own blog and was wondering what all is needed to get setup? I’m assuming having a blog like yours would cost a pretty penny? I’m not very web smart so I’m not 100% certain. Any suggestions or advice would be greatly appreciated. Cheers

  17. We stumbled over here different website and thought I might check things out. I like what I see so now i am following you. Look forward to looking over your web page again.

  18. Hello! I just wanted to ask if you ever have any problems with hackers? My last blog (wordpress) was hacked and I ended up losing several weeks of hard work due to no backup. Do you have any solutions to prevent hackers?

  19. Hi there! I know this is kind of off-topic but I had to ask. Does operating a well-established blog like yours require a large amount of work? I am brand new to writing a blog however I do write in my diary everyday. I’d like to start a blog so I will be able to share my experience and thoughts online. Please let me know if you have any kind of recommendations or tips for brand new aspiring bloggers. Appreciate it!

  20. Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point. You obviously know what youre talking about, why throw away your intelligence on just posting videos to your blog when you could be giving us something informative to read?

  21. Hi there this is somewhat of off topic but I was wondering if blogs use WYSIWYG editors or if you have to manually code with HTML. I’m starting a blog soon but have no coding skills so I wanted to get advice from someone with experience. Any help would be greatly appreciated!

  22. With havin so much content and articles do you ever run into any problems of plagorism or copyright infringement? My site has a lot of exclusive content I’ve either authored myself or outsourced but it appears a lot of it is popping it up all over the internet without my permission. Do you know any techniques to help stop content from being ripped off? I’d genuinely appreciate it.

  23. Hello there! Do you know if they make any plugins to help with Search Engine Optimization? I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good results. If you know of any please share. Many thanks!

  24. Hi there! This is my first visit to your blog! We are a group of volunteers and starting a new project in a community in the same niche. Your blog provided us useful information to work on. You have done a extraordinary job!

  25. I really like what you guys are up too. Such clever work and reporting! Keep up the very good works guys I’ve included you guys to my blogroll.

  26. Everyone loves what you guys tend to be up too. This sort of clever work and exposure! Keep up the fantastic works guys I’ve incorporated you guys to my blogroll.

  27. My spouse and I stumbled over here coming from a different website and thought I may as well check things out. I like what I see so now i’m following you. Look forward to exploring your web page repeatedly.

  28. Good day! This post could not be written any better! Reading through this post reminds me of my old room mate! He always kept talking about this. I will forward this article to him. Fairly certain he will have a good read. Thanks for sharing!

  29. Howdy, i read your blog occasionally and i own a similar one and i was just wondering if you get a lot of spam feedback? If so how do you stop it, any plugin or anything you can advise? I get so much lately it’s driving me insane so any assistance is very much appreciated.

  30. Hi! I understand this is somewhat off-topic but I had to ask. Does managing a well-established blog such as yours take a lot of work? I’m completely new to running a blog however I do write in my journal every day. I’d like to start a blog so I will be able to share my experience and thoughts online. Please let me know if you have any ideas or tips for new aspiring bloggers. Appreciate it!

  31. Hi are using WordPress for your blog platform? I’m new to the blog world but I’m trying to get started and create my own. Do you need any html coding knowledge to make your own blog? Any help would be really appreciated!

  32. Do you mind if I quote a few of your articles as long as I provide credit and sources back to your weblog? My blog site is in the very same area of interest as yours and my users would definitely benefit from some of the information you present here. Please let me know if this okay with you. Many thanks!

  33. Admiring the time and energy you put into your blog and in depth information you provide. It’s awesome to come across a blog every once in a while that isn’t the same unwanted rehashed information. Great read! I’ve bookmarked your site and I’m including your RSS feeds to my Google account.

  34. I know this if off topic but I’m looking into starting my own blog and was wondering what all is required to get set up? I’m assuming having a blog like yours would cost a pretty penny? I’m not very internet smart so I’m not 100% positive. Any tips or advice would be greatly appreciated. Thank you

  35. I’m really loving the theme/design of your web site. Do you ever run into any browser compatibility issues? A handful of my blog visitors have complained about my site not operating correctly in Explorer but looks great in Firefox. Do you have any suggestions to help fix this problem?

  36. With havin so much written content do you ever run into any problems of plagorism or copyright infringement? My site has a lot of unique content I’ve either authored myself or outsourced but it seems a lot of it is popping it up all over the internet without my permission. Do you know any methods to help prevent content from being stolen? I’d really appreciate it.

  37. Superb website you have here but I was curious about if you knew of any forums that cover the same topics talked about in this article? I’d really love to be a part of group where I can get feedback from other experienced individuals that share the same interest. If you have any suggestions, please let me know. Thanks a lot!

  38. Hi there would you mind stating which blog platform you’re working with? I’m planning to start my own blog in the near future but I’m having a hard time selecting between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your design and style seems different then most blogs and I’m looking for something completely unique. P.S Apologies for being off-topic but I had to ask!

  39. Hola! I’ve been following your blog for a while now and finally got the bravery to go ahead and give you a shout out from Houston Texas! Just wanted to tell you keep up the great job!

  40. Hello there! This is kind of off topic but I need some help from an established blog. Is it very difficult to set up your own blog? I’m not very techincal but I can figure things out pretty quick. I’m thinking about creating my own but I’m not sure where to start. Do you have any ideas or suggestions? Appreciate it

  41. I enjoy what you guys are up too. This sort of clever work and coverage! Keep up the terrific works guys I’ve included you guys to blogroll.

  42. Hello! I could have sworn I’ve been to this blog before but after browsing through some of the post I realized it’s new to me. Nonetheless, I’m definitely happy I found it and I’ll be book-marking and checking back often!

  43. Do you have a spam issue on this website; I also am a blogger, and I was wondering your situation; many of us have developed some nice procedures and we are looking to swap methods with other folks, please shoot me an e-mail if interested.

  44. When I initially commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get four emails with the same comment. Is there any way you can remove people from that service? Many thanks!

  45. Hey there! Do you know if they make any plugins to assist with Search Engine Optimization? I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good results. If you know of any please share. Thanks!

  46. Hi there would you mind letting me know which webhost you’re using? I’ve loaded your blog in 3 completely different internet browsers and I must say this blog loads a lot faster then most. Can you recommend a good web hosting provider at a fair price? Thanks a lot, I appreciate it!

Leave a Reply

Your email address will not be published. Required fields are marked *