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

440 thoughts on “More Linux Bash Commands

  1. Hello there! This is my 1st comment here so I just wanted to give a quick shout out and tell you I genuinely enjoy reading through your articles. Can you recommend any other blogs/websites/forums that cover the same topics? Thanks a ton!

  2. Thanks for your marvelous posting! I seriously enjoyed reading it, you’re a great author.I will always bookmark your blog and will often come back sometime soon. I want to encourage yourself to continue your great work, have a nice weekend!

  3. Greetings! I know this is somewhat off topic but I was wondering which blog platform are you using for this site? I’m getting sick and tired of WordPress because I’ve had issues with hackers and I’m looking at alternatives for another platform. I would be awesome if you could point me in the direction of a good platform.

  4. Hmm is anyone else experiencing problems with the pictures on this blog loading? I’m trying to determine if its a problem on my end or if it’s the blog. Any feedback would be greatly appreciated.

  5. Hey! Someone in my Myspace group shared this website with us so I came to take a look. I’m definitely enjoying the information. I’m bookmarking and will be tweeting this to my followers! Great blog and superb style and design.

  6. Wonderful blog you have here but I was curious about if you knew of any user discussion forums that cover the same topics discussed in this article? I’d really love to be a part of community where I can get comments from other knowledgeable people that share the same interest. If you have any recommendations, please let me know. Appreciate it!

  7. I was wondering if you ever thought of changing the structure of your site? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having one or 2 pictures. Maybe you could space it out better?

  8. I’m really enjoying the design and layout of your site. It’s a very easy on the eyes which makes it much more pleasant for me to come here and visit more often. Did you hire out a developer to create your theme? Great work!

  9. Heya! I’m at work surfing around your blog from my new apple iphone! Just wanted to say I love reading through your blog and look forward to all your posts! Carry on the fantastic work!

  10. I don’t know if it’s just me or if everybody else encountering problems with your site. It appears as if some of the text in your posts are running off the screen. Can somebody else please comment and let me know if this is happening to them as well? This might be a problem with my browser because I’ve had this happen before. Kudos

  11. Hi there just wanted to give you a quick heads up. The text in your content seem to be running off the screen in Safari. I’m not sure if this is a format issue or something to do with internet browser compatibility but I thought I’d post to let you know. The style and design look great though! Hope you get the problem resolved soon. Many thanks

  12. Admiring the hard work you put into your blog and in depth information you present. It’s great to come across a blog every once in a while that isn’t the same old rehashed material. Great read! I’ve bookmarked your site and I’m including your RSS feeds to my Google account.

  13. I really like your blog.. very nice colors & theme. Did you design this website yourself or did you hire someone to do it for you? Plz respond as I’m looking to construct my own blog and would like to know where u got this from. thanks a lot

  14. Hey there! 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 problems with hackers and I’m looking at alternatives for another platform. I would be fantastic if you could point me in the direction of a good platform.

  15. Great blog! Do you have any tips and hints for aspiring writers? I’m hoping to start my own blog soon but I’m a little lost on everything. Would you propose starting with a free platform like WordPress or go for a paid option? There are so many choices out there that I’m totally overwhelmed .. Any suggestions? Kudos!

  16. Please let me know if you’re looking for a article author for your site. You have some really great posts and I believe I would be a good asset. If you ever want to take some of the load off, I’d really like to write some material for your blog in exchange for a link back to mine. Please blast me an e-mail if interested. Kudos!

  17. I’m not sure why but this weblog is loading incredibly 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.

  18. Hmm it seems like your website ate my first comment (it was super long) so I guess I’ll just sum it up what I wrote 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 certainly appreciate it.

  19. Woah! I’m really enjoying the template/theme of this blog. It’s simple, yet effective. A lot of times it’s challenging to get that “perfect balance” between superb usability and visual appeal. I must say that you’ve done a awesome job with this. In addition, the blog loads very fast for me on Chrome. Outstanding Blog!

  20. I do not know if it’s just me or if perhaps everybody else experiencing problems with your website. It appears as if some of the written text within your posts are running off the screen. Can somebody else please provide feedback and let me know if this is happening to them too? This might be a problem with my web browser because I’ve had this happen previously. Appreciate it

  21. Hmm is anyone else having problems with the pictures on this blog loading? I’m trying to figure out if its a problem on my end or if it’s the blog. Any feed-back would be greatly appreciated.

  22. Howdy! I’m at work surfing around your blog from my new iphone! Just wanted to say I love reading through your blog and look forward to all your posts! Carry on the fantastic work!

  23. This design is spectacular! You definitely know how to keep a reader amused. Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Great job. I really loved what you had to say, and more than that, how you presented it. Too cool!

  24. Hey there! This is my first comment here so I just wanted to give a quick shout out and tell you I really enjoy reading your posts. Can you recommend any other blogs/websites/forums that cover the same topics? Many thanks!

  25. Hey there! This is my first comment here so I just wanted to give a quick shout out and say I truly enjoy reading through your posts. Can you suggest any other blogs/websites/forums that go over the same subjects? Many thanks!

  26. First of all I want to say wonderful blog! I had a quick question in which I’d like to ask if you don’t mind. I was curious to know how you center yourself and clear your mind prior to writing. I have had difficulty clearing my mind in getting my ideas out there. I do enjoy writing but it just seems like the first 10 to 15 minutes tend to be lost just trying to figure out how to begin. Any suggestions or tips? Cheers!

  27. Have you ever considered creating an e-book or guest authoring on other sites? I have a blog centered on the same information you discuss and would really like to have you share some stories/information. I know my visitors would appreciate your work. If you’re even remotely interested, feel free to send me an e mail.

  28. Please let me know if you’re looking for a author for your site. You have some really good articles and I feel I would be a good asset. If you ever want to take some of the load off, I’d love to write some content for your blog in exchange for a link back to mine. Please send me an e-mail if interested. Kudos!

  29. First off I want to say fantastic blog! I had a quick question that I’d like to ask if you don’t mind. I was interested to know how you center yourself and clear your head prior to writing. I have had a hard time clearing my mind in getting my thoughts out there. I truly do take pleasure in writing but it just seems like the first 10 to 15 minutes are usually lost simply just trying to figure out how to begin. Any suggestions or hints? Thank you!

  30. 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 three emails with the same comment. Is there any way you can remove me from that service? Appreciate it!

  31. Greetings from Carolina! I’m bored at work so I decided to browse your site on my iphone during lunch break. I really like the info you provide here and can’t wait to take a look when I get home. I’m surprised at how quick your blog loaded on my cell phone .. I’m not even using WIFI, just 3G .. Anyhow, amazing site!

  32. Terrific post however I was wondering if you could write a litte more on this topic? I’d be very grateful if you could elaborate a little bit further. Thank you!

  33. First off I want to say superb blog! I had a quick question in which I’d like to ask if you do not mind. I was curious to find out how you center yourself and clear your head before writing. I have had a tough time clearing my thoughts in getting my ideas out there. I truly do enjoy writing however it just seems like the first 10 to 15 minutes are generally wasted simply just trying to figure out how to begin. Any recommendations or tips? Cheers!

  34. Howdy! I understand this is kind of off-topic however I had to ask. Does building a well-established website like yours take a large amount of work? I am brand new to writing a blog however I do write in my journal every day. I’d like to start a blog so I can easily share my personal experience and thoughts online. Please let me know if you have any recommendations or tips for brand new aspiring blog owners. Appreciate it!

  35. With havin so much content and articles do you ever run into any issues of plagorism or copyright violation? My blog has a lot of exclusive 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 ways to help stop content from being stolen? I’d definitely appreciate it.

  36. Howdy 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 suggest a good hosting provider at a honest price? Kudos, I appreciate it!

  37. Hey! I know this is somewhat off topic but I was wondering which blog platform are you using for this site? I’m getting tired of WordPress because I’ve had issues with hackers and I’m looking at options for another platform. I would be great if you could point me in the direction of a good platform.

  38. Hey! Someone in my Myspace group shared this site with us so I came to give it a look. I’m definitely enjoying the information. I’m book-marking and will be tweeting this to my followers! Great blog and outstanding design and style.

  39. Awesome blog! Do you have any tips and hints for aspiring writers? I’m hoping to start my own website soon but I’m a little lost on everything. Would you propose starting with a free platform like WordPress or go for a paid option? There are so many options out there that I’m completely overwhelmed .. Any tips? Thanks!

  40. Currently it seems like Expression Engine is the top blogging platform available right now. (from what I’ve read) Is that what you are using on your blog?

Leave a Reply

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