Quantcast
Channel: SnifferDog IT
Viewing all articles
Browse latest Browse all 107

Linux Shell commands explained

$
0
0

You just starting on Linux and you are now thinking that you use to know all of the commands for DOS and now you don’t have a clue about Linux shell commands.Well, if you speak English you will see they are very easy to learn and they are just abbreviations of what the word for that command should be and many are just shorter than the ones you knew from DOS.

You can do pretty much anything with the bash commands in your system, just remember, unlike windows the Linux command-line is CASE-SENSITIVE   and gets very upset if you forget about that, or will delete that file you didn’t want to,  just because you forgot it was not the ”Example.doc” you wanted to delete but the “example.doc”.

Here is a list of the built-in and the external bash commands that you should have as standard in your system, you will then have to learn the ones for any specific application you want to use, as applications have their own commands and rules, but those are application commands and not general bash commands.

Built-in commands:
alias           - Define an alias for the specified command.
bg               - Resume a job in background mode.
bind           - Bind a keyboard sequence to a readline function or macro.
break         - Exit from a for, while, select, or until loop.
builtin        - Execute the specified shell built-in command.
cd               - Change the current directory to the specified directory.
caller          - Return the context of any active subroutine call.
command - Execute the specified command without the normal shell lookup.
compgen  – Generate possible completion matches for the specified word.
complete  - Display how the specified words would be completed.
continue   - Resume the next iteration of a for, while, select, or until loop.
declare      - Declare a variable or variable type.
dirs             - Display a list of currently remembered directories.
disown      - Remove the specified jobs from the jobs table for the process.
echo          - Display the specified string to STDOUT.
enable       - Enable or disable the specified built-in shell command.
eval            – Concatenate the specified arguments into a single command, then execute the command.
exec          - Replace the shell process with the specified command.
exit            – Force the shell to exit with the specified exit status.
export      – Set the specified variables to be available for child shell processes.
fc               - Select a list of commands from the history list.
fg               - Resume a job in foreground mode.
getopts    – Parse the specified positional parameters.
hash         - Find and remember the full pathname of the specified command.
help          – Display a help file.
history     - Display the command history.
jobs          – List the active jobs.
kill             - Send a system signal to the specified process ID (PID).
let             - Evaluate each argument in a mathematical expression.
local         - Create a limited-scope variable in a function.
logout      – Exit a login shell.
popd        - Remove entries from the directory stack.
printf        – Display text using formatted strings.
pushd     - Add a directory to the directory stack.
pwd         - Display the pathname of the current working directory.
read        – Read one line of data from STDIN and assign it to a variable.
readonly - Read one line of data from STDIN and assign it to a variable that can’t be changed.
return     - Force a function to exit with a value that can be retrieved by the calling script.
set           - Set and display environment variable values and shell attributes.
shift        – Rotate positional parameters down one position.
shopt    – Toggle the values of variables controlling optional shell behavior.
suspend - Suspend the execution of the shell until a SIGCONT signal is received.
test        – Return an exit status of 0 or 1 based on the specified condition.
times     - Display the accumulated user and system.
trap        – Execute the specified command if the specified system signal is received.
type       - Display how the specified word would be interpreted and used as a command.
ulimit     - Set a limit on the specified resource for system users.
umask  - Set default permissions for newly created files and directories.
unalias - Remove the specified alias.
unset    - Remove the specified environment variable or shell attribute.
wait       - Wait for the specified process to complete, and return the exit status.

External commands

bzip2         - Compression using the Burrows-Wheeler block sorting text compression algorithm and Huffman coding.
cat              – List the contents of the specified file.
chage        – Change the password expiration date for the specified system user account.
chfn           - Change the specified user account’s comment information.
chgrp         - Change the default group of the specified file or directory.
chmod       - Change system security permissions for the specified file or directory.
chown        – Change the default owner of the specified file or directory.
chpasswd - Reads a file of login name and password pairs and updates the passwords.
chsh          – Change the specified user account’s default shell.
compress - Original Unix file compression utility.
cp               - Copy the specified files to an alternate location.
df               - Display current disk space statistics for all mounted devices.
du              - Display disk usage statistics for the specified filepath.
file              – View the file type of the specified file.
finger         - Display information about user accounts on the Linux system or a remote system.
grep           - Search a file for the specified text string.
groupadd - Create a new system group.
groupmod - Modify an existing system group.
gzip             - The GNU Project’s compression using Lempel-Ziv compression.
head          – Display the first portion of the specified file’s contents.
killall          – Send a system signal to a running process based on process name.
less           -  Advanced viewing of file contents.
link            – Create a link to a file using an alias name.
ls               - List directory contents.
mkdir       - Create the specified directory under the current directory.
more       - List the contents of the specified file, pausing after each screen of data.
mount     - Display or mount disk devices into the virtual file system.
passwd   - Change the password for a system user account.
ps              – Display information about the running processes on the system.
pwd         - Display the current directory.
mv           - Move a file.
rm            – Delete the specified file.
rmdir       -  Delete the specified directory.
sort         - Organize data in a data file based on the specified order.
stat          – View the file statistics of the specified file.
tail           - Display the last portion of the specified file’s contents.
tar           - Archive data and directories into a single file.
touch      – Create a new empty file, or update the timestamp on an existing file.
umount  - Remove a mounted disk device from the virtual file system.
useradd - Create a new system user account.
userdel   - Remove an existing system user account.
usermod - Modify an existing system user account.
zip            - Unix version of the Windows PKZIP program.

Examples:

user@linux:~$cp example.doc /home/userA/DocumentsCopy example.doc to folder documents for userA.

user@linux:~$mv example.doc /home/userA/Documents – Move example.doc to folder documents for userA.

user@linux:/home$rm example.doc - Delete example.doc.


Filed under: Linux Command Line Made Easy Tagged: Command-line interface, Concatenate, DOS, Exit status, File Management, Linux, Operating system, Shell, Standard streams, Unix shell, Working directory

Viewing all articles
Browse latest Browse all 107

Latest Images

Trending Articles





Latest Images