0% found this document useful (0 votes)
67 views

Unix Week1 PDF

The document discusses Linux commands that can be used for day 1 of a Linux commands course. It provides textbooks and online references for learning Unix commands and introduces some basic commands like cal, date, clear, ls, cat, echo, mkdir, rm, and history. It also discusses commands for managing packages (sudo apt-get update, sudo apt-get upgrade), displaying user information (who, whoami), and navigating the file system (pwd, cd).

Uploaded by

Shankar Nath
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views

Unix Week1 PDF

The document discusses Linux commands that can be used for day 1 of a Linux commands course. It provides textbooks and online references for learning Unix commands and introduces some basic commands like cal, date, clear, ls, cat, echo, mkdir, rm, and history. It also discusses commands for managing packages (sudo apt-get update, sudo apt-get upgrade), displaying user information (who, whoami), and navigating the file system (pwd, cd).

Uploaded by

Shankar Nath
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Linux Commands

Day 1
Text Books for Unix Commands
UNIX : Concepts and Applications | 4th Edition
by Sumitabha Das | 1 July 2017 | McGraw Hill Education

Linux Command Bible 3e | 3rd Edition


by Richard Blum, Christine Bresnahan | 20 January 2015 | Wiley

The Linux Command Line: A Complete Introduction | 2nd Edition


by William Shotts | 7 March 2019 | No Starch Press
Quick links for Unix Commands

https://www.geeksforgeeks.org/linux-commands/

https://www.geeksforgeeks.org/introduction-linux-shell-shell-scripting/

https://www.geeksforgeeks.org/sed-command-in-linux-unix-with-examples/

https://www.geeksforgeeks.org/awk-command-unixlinux-examples/
Tentative Evaluation Details

● Mid Sem: 30 Marks


● End Sem: 40 Marks
● Lab Evaluation: 30 Marks

● Unix (Mid Sem)


● Mid Sem: 30 Marks
● Lab Evaluation: 15 Marks

● Python (End Sem)


● End Sem: 40 Marks
● Lab Evaluation: 15 Marks
sudo
sudo: It allows a permitted user to execute a command as the superuser or another user, as
specified by the security policy. The invoking user's real (not effective) user-ID is used to
determine the user name with which to query the security policy.

Syntax: sudo -h | -K | -k | -V
sudo -v [-ABknS] [-g group] [-h host] [-p prompt] [-u user]
Output:
Update and Upgrade

tanima@tanima-Inspiron-13-5378:~$ sudo apt-get update

tanima@tanima-Inspiron-13-5378:~$ sudo apt-get upgrade


sudo apt-get update
sudo apt-get upgrade
sudo apt-get install
Date
date: Display the current time in the given FORMAT, or set the system date.
Syntax: date [OPTION]... [+FORMAT]
date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
Output:
Banner sudo apt install sysvbanner

banner: banner prints out the first 10 characters of text in large letters
Syntax: banner text
Output:
sudo apt-get install sudo apt install
sysvbanner
clear
clear: It clears your screen if this is possible,
including its scrollback buffer (if the extended
“E3” capability is defined). clear looks in the
environment for the terminal type given by the
environment variable TERM, and then in the
terminfo database to determine how to clear
the screen.

Syntax: clear [-Ttype] [-V] [-x]


Output:
cal
cal : The cal utility displays a simple calendar in traditional format and ncal offers an alternative
layout, more options and the date of Easter. If arguments are not specified, the current month is
displayed. It makes a year fit on a 25x80 terminal.

Syntax: cal [-31jy] [-A number] [-B number] [-d yyyy-mm] [[month] year]

Output:
cal jan 2021, cal 7 2019
Output:
man
man : man is the system's manual pager. Each page argument given to man is normally the
name of a program, utility or function. The manual page associated with each of these
arguments is then found and displayed.
Syntax: man [man options] [[section] page ...] ...
man cal
who
who : Print information about users who are currently logged in.

Syntax: who [OPTION]... [ FILE | ARG1 ARG2 ]

Output:
whoami
whoami : Print the user name associated with the current effective user ID.
Syntax: whoami [OPTION]
Output:
pwd, ls
pwd: print name of current/working directory
Syntax: pwd [OPTION]...

ls: List information about the FILEs (the current directory by default).
Syntax: ls [OPTION] [FILE]

Output:
cd, cd .., mkdir
cd: change directory
Syntax: cd [-L|[-P
[-e]] [-@]] [dir]

mkdir : Create the


DIRECTORY(ies), if
they do not already
exist.
Syntax: mkdir
[OPTION]
DIRECTORY

Output:
man ls
ls -l
ls > list
man ls
ls -Z
ls -a
cat
cat: Concatenate FILE(s) to standard output.
Syntax: cat [OPTION] [FILE]

Output: cat list


man wc
wc list
ls | wc
wc list > newlist
echo
echo: Echo the STRING(s) to standard output.

Syntax: echo [SHORT-OPTION] [STRING]


echo LONG-OPTION

Output:
echo $x, echo $PATH
mkdir chapter1, mkdir chapter2,
cd chapter1, ls chap*, ls -l chap*
rm, rmdir
rm: This manual page documents the GNU version of rm.

Syntax: rm [OPTION] [FILE]

rmdir: Remove the DIRECTORY(ies), if they are empty.

Syntax: rmdir [OPTION] DIRECTORY

Output:
history > history1.txt
Output: store all the previous command in .txt
man bc
help, exit, sudo poweroff
help, exit,
sudo poweroff

You might also like