Some LINUX commands

Linux Commands
Commands Description Example
man Description of the command $ man any_linux_command
cd Change Directory $ cd Desktop
mkdir Create new folder(s) $ mkdir folder_name
rmdir Remove folder(s) $ rmdir folder_name
ls List information about file(s) $ ls directory_name
cat Concatenate and print (display) the content of files 1. $ cat > filename.txt (to create)
2. $ cat filename.txt (to display)
pwd Print Working Directory $ pwd
man Help manual $ man any_command
wc Print byte, word, and line count $ wc filename.txt
touch Change file timestamps $ touch filename.txt
stat Display file or file system status $ stat filename.txt
rm Remove files $ rm filename.txt
date Display or change the date & time $ date “+Date: %d/%m/%y Time: %H/%M/%s”
who Print all usernames currently logged in $ who
whoami Print the current user id and name (`id -un’) $ who am i
vi Text Editor $ vi filename.txt
chmod Change access permissions $ chmod 721 filename.txt
cp Copy one or more files to another location $ cp file1.txt file2.txt
mv Move or rename files or directories $ mv file1.txt file2.txt
passwd Modify a user password $ passwd
gedit Edit the file content $ gedit filename.txt
C Programing
Commands Description
$ gedit a.c Opening a C program editor of filename a.c
$ gcc a.c -o a1 Compiling the C program (instead of a1, you can use any name)
$ ./a1 Running the C program
Some Shell Programing commands
Commands Description Syntax
read Read a line from standard input read(int fd, buffer or message, int size)
write Send a message to another user write(int fd, buffer or message, int size)
open Open a file in its default application open(“file.extension”, O_RDWR/O_CREAT, 0764 or any permission)

Some header files that we use while performing system call

<stdio.h>

<sys/types.h>

<sys/stat.h>

<fcntl.h>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s