CE Quick Reference : Linux Commands.

Abhishek Rawal

Abhishek Rawal

@abhishek-fg9tRh Oct 15, 2024
This tutorial is for tenderfoot users of Linux.This tutorial will teach you to perform the basic tasks using the "Terminal".

------------------------------------------------------------------------------------------------
  • Logging & Session Management :
login
Use : To Log into system
Syntax : login <username>
Example : login Abhishek

rlogin
Use : To Log into another computer on LAN or internet.
Syntax : rlogin -l <username> <address>
Example : rlogin -l Abhishek crazyengineers.com

shutdown
Use1 : To restart the computer
Command : Shutdown -r now

Use2 : To halt the computer now (or after given time)
Command : shutdown -h <time>
Example1 : shutdown -h now (will halt the PC now)
Example2: shutdown -h +12 (will halt the PC after 12 minutes)

tty
Use : Identify the number of terminal being used
Command : tty
-------------------------------------------------------------------------------------------------
  • Linux File-system Navigation :
First Learn the basics of Linux File system before moving forward.
You can download the book : #-Link-Snipped-# .(It's not finished yet, but even though you'll be able to understand the Linux filesystems.)

Shell Pattern With Examples

Pattern : *
Use : Matches one or more than one characters
Example : *.deb (This will match all files with .deb extension)

Pattern : ?
Use : Matches a single character.
Example : abhishek?.ppt (It will match single alphabet like abhishek2.ppt, abhishekx.ppt,abhishek4.ppt etc.)

Pattern : [character1-character2]
Use : Matches any characters from range of character1 & character2.
Example : glory[1-5].pdf (I will match glory1,glory2 upto glory5)

Commands

cd
Use : Changes the current directory.
Syntax : cd [directory]
Example : cd /usr/bin (It will change the current directory to /usr/bin from previous directory)

ls
Use : List the files in current directory
Syntax : ls [pattern]
Example : ls *.deb (It will list only files with .deb extension)
Example : ls (It will list all files under current directory)

dir
Use : List the files in directory in case-sensitive,alphabetical order.It's identical to that of ls.
Syntax : dir [options] [pattern]
Example : dir -R *.png (Lists all files with .png extension in current directory & associated sub-directories)

free
Use : Shows available memory,used memory,kernel buffers,cached memory, swap file.
Syntax : free [option]
Example : free -m (It will show result in megabytes)

mkdir
Use : To create the directory
Syntax : mkdir <name_of_directory>
Example : mkdir Crazyengineers (It will create a folder named "Crazyengineers" in current directory)

popd
Use : This command removes specified directory from stack & makes it the current one.
Syntax : popd [option]
Example : popd -n (Cycles the stack making the nth directory from bottom of stack at the top)

pushd
Use : This command switches to top directory of stack & making top directory the current one.
Syntax : pushd [option]
Example : pushd +n (Cycles the stack directory making the nth directory at the top)

vdir
Use : It lists the files of current directory in case-sensitive & alphabetical order with permission modes details.
Syntax : vdir [option]
Example : vdir *.py (It will list all python extension(.py) files in alphabetical order with permission modes detail)

- More to come-
-Will cover all commands which I know-

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform