Linux/Unix Commands | Code Factory


Donate : Link

Medium Blog : Link

Applications : Link

.

  • . filename [arguments] Execute commands from a file in the current shell

–help

A

addgroup

atrm

awk

  • https://yourcodeacademy.wordpress.com/2021/08/11/awk-command-in-linux-unix-with-examples-code-factory/
  • awk splits each line into fields/columns and help us perform actions on matched patterns and process data.
  • awk is a scripting language used for manipulating data and generating reports. The awk command programming language requires no compiling, and allows the user to use variables, numeric functions, string functions, and logical operators.
  • COMMAND DESCRIPTION
    awk [options] [awk program] [file]…
    -v VAR-VAL Set variable
    -F SET Use SEP as field separator
    -f FILE Read program from FILE

B

bc

C

cat

cd

chage

chgrp

chmod

chown

Usage: chown[OPTION]... [OWNER][:[GROUP]] FILE...
or:  chown[OPTION]... --reference=RFILE FILE...

cmp

  • https://yourcodeacademy.wordpress.com/2021/08/24/cmp-command-in-linux-unix-with-examples-code-factory/
  • cmp command in Linux/UNIX is used to compare the two files byte by byte and helps you to find out whether the two files are identical or not.
  • When cmp is used for comparison between two files, it reports the location of the first mismatch to the screen if difference is found and if no difference is found i.e the files compared are identical.
  • cmp displays no message and simply returns the prompt if the the files compared are identical.

Usage: cmp [OPTION]… FILE1 [FILE2 [SKIP1 [SKIP2]]]

comm

Usage: comm [OPTION]… FILE1 FILE2
Compare sorted files FILE1 and FILE2 line by line.

cp

Usage: cp [OPTION]… [-T] SOURCE DEST
or: cp [OPTION]… SOURCE… DIRECTORY
or: cp [OPTION]… -t DIRECTORY SOURCE…
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.

cpio

cut

Usage: cut OPTION… [FILE]…
Print selected parts of lines from each FILE to standard output.
With no FILE, or when FILE is -, read standard input.

D

date

Usage: date [OPTION]… [+FORMAT]
or: date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
Display the current time in the given FORMAT, or set the system date.

delgroup

deluser

deluser USER
remove a normal user from the system
example: deluser mike
delgroup GROUP
deluser --group GROUP
remove a group from the system
example: deluser --group students
deluser USER GROUP
remove the user from a group
example: deluser mike students

df

Usage: df [OPTION]… [FILE]…
Show information about the file system on which each FILE resides,
or all file systems by default.

du

Usage: du [OPTION]… [FILE]…
or: du [OPTION]… --files0-from=F
Summarize disk usage of the set of FILEs, recursively for directories.

E

echo

echo: echo [-neE] [arg …]
Write arguments to the standard output.

eval

  • https://yourcodeacademy.wordpress.com/2021/09/11/eval-command-in-linux-unix-with-examples-code-factory/
  • eval is a built-in Linux command which is used to execute arguments as a shell command. It combines arguments into a single string and uses it as an input to the shell and execute the commands.
  • eval command comes in handy when you have a unix or linux command stored in a variable and you want to execute that command stored in the string. The eval command first evaluates the argument and then runs the command stored in the argument.

eval: eval [arg …]
Execute arguments as a shell command.

expand

Usage: expand [OPTION]… [FILE]…
Convert tabs in each FILE to spaces, writing to standard output.
With no FILE, or when FILE is -, read standard input.

expr

Usage: expr EXPRESSION
or: expr OPTION
Print the value of EXPRESSION to standard output.

F

find

Usage: find [-H] [-L] [-P] [-Olevel] [-D debugopts] [path…] [expression]
default path is the current directory

fold

  • https://yourcodeacademy.wordpress.com/2021/09/14/fold-command-in-linux-unix-with-examples-code-factory/
  • fold is a Unix command used for making a file with long lines more readable on a limited width computer terminal by performing a line wrap.
  • Most Unix terminals have a default screen width of 80, and therefore reading files with long lines could get annoying. The fold command puts a line feed every X characters if it does not reach a new line before that point. If the -w argument is set, the fold command allows the user to set the maximum length of a line.

Usage: fold [OPTION]… [FILE]…
Wrap input lines in each FILE, writing to standard output.
With no FILE, or when FILE is -, read standard input.

G

grep

Usage: grep [OPTION]… PATTERNS [FILE]…
Search for PATTERNS in each FILE.
Example: grep -i 'hello world' menu.h main.c
PATTERNS can contain multiple patterns separated by newlines.

groupadd

  • https://yourcodeacademy.wordpress.com/2021/09/19/groupadd-command-in-linux-unix-with-examples-code-factory/
  • Groups in Linux refer to the user groups. In Linux, there can be many users of a single system, (normal user can take uid from 1000 to 60000, and one root user (uid 0) and 999 system users (uid 1 to 999)). In a scenario where there are many users, there might be some privileges that some users have and some don’t, and it becomes difficult to manage all the permissions at the individual user level. So using groups, we can group together a number of users, and set privileges and permissions for the entire group. groupadd command is used to create a new user group.

Usage: groupadd [options] GROUP

groupdel

Usage: groupdel [options] GROUP

groupmod

Usage: groupmod [options] GROUP

groups

Usage: groups [OPTION]… [USERNAME]…
Print group memberships for each USERNAME or, if no USERNAME is specified, for
the current process (which may differ if the groups database has changed).

H

head

history

I

id

ipaddress

ipconfig

ipcs

L

link

ll

ln

ls

M

man

mkdir

mv

N

nslookup

P

passwd

paste

ps

pwd

  • Print work directory

R

rm

rmdir

rpm

S

scp

sed

  • sed command in UNIX is stands for stream editor and it can perform lot’s of function on file like, searching, find and replace, insertion or deletion.

select

service

sh

sort

source

  • Execute commands from a file in the current shell

ssh

ssh-add

su

  • Switch user

sudo

systemctl

T

tac

tar

tail

tee

  • tee command reads the standard input and writes it to both the standard output and one or more files.

touch

  • Update the access and modification time of each FILE to the current time.

tr

traceroute

tree

U

uniq

unlink

uptime

useradd

  • User addition

userdel

  • User deletion

usermod

  • User modification

userpath

users

uucp

V

vi

  • Visual editor
  • View file

view

W

wc

which

whoami

X

xargs

Z

zip

zipdetails

zipgrep

zipinfo

zipnote

zipsplit

Leave a comment