Bash Commands Guide
--
Update: January 5, 2020
Bash is an interactive command-line interpreter or shell. I would like to share the common usage of my shell commands and what they are. I have created this list for time-saving purposes. Because without GUI, all transaction moves faster without mouse usage.
This article is a guide for my next article — Bash Script Guide for iOS Developers, stay tuned for that!
History
$ history
used to sort the commands used for the previous.
Nslookup
$ nslookup
allows you to query the IP address directed by the DNS server
ifconfig
$ ifconfig
shows the machine’s IP configuration.
ls
Lists the folder and file names in the current working directory.
$ ls -a
lists all files including hidden files
$ ls -A
lists all files, including hidden files, except a top directory
$ ls -F
add an indicator (one of */=>@|) to entries
$ ls -S
sort by file size
$ ls -al
provides a list of all the files in the same directory
$ ls -l
Use a long listing format
$ ls -nl
Use a long listing format with user ID
$ ls -c
list contents by columns
MAN
It is the interface used to view the system’s reference manuals.man ls
also displays all the options available for running the command.
$ man -
Print a help message and exit
$ man -V --version
Display version information and exit
$ man -C
Use the configuration file rather than the default of ~/.manpath.
$ man -d
Print debugging information.
ENV
Returns a list of the environment variables for the current user.
$ env
CHMOD
To change the permissions of files or directories.
$ chmod 777
anyone can read, write and execute chmod 777 my_file