File System : A file is a sequence of bytes. A byte is 8 bit long equivalent to a character.
In LINUX, files are created using different methods, using different text editor.
Standard LINUX text editor is a program called ED written by Ken Thomson.
Screen editor or Visual Editor:It is an editor that takes advantages of modern terminals to display the effects of editing changes in context assuming.
List of Commands
File or Directory command
pwd - Finds out what current directory is (print working directory)
mkdir - Make a new directory.
cd dirname - Change directory, to go to specified directory.
cd\ - Return to home directory.
cd .. - Move up one level.
rmdir - Removes the directory. Before removing the directory, all files in
that directory must be removed.
ed filename - Edit the file.
cp file1 file2 - Copy the contents of file1 to file2. overwrites the old file2 if it
mv file1 file2- Move the contents of file1 to file2
rm filename - Removes the particular file.
rm* - Removes all the files in the current directory.
cat filename - Prints the contents of the particular file.
pr filename - Prints the contents of the file in ‘n’ columns.
pr* - Prints all the files in current working directory in alphabetical
ls - Lists the names of all files in the directory.
ls dirname - List only the files in the directory.
ls -t - List the files in time order (most recent files first).
ls –l - Give the list of files with more information.
ls –lt - Gives the same data as ls –l option but the information are stored
in more recently used order.
ls –u - list the files by time, last modified.
ls –lut - Gives long information in order of most recent used.
ls -r - List in reverse order of output.
ls -rt - List in order of least recent used.
ls -rlt - List long information in order of least recent used.
ls –i - Reports the i - mode number.
chmod permission filename - Change the permission files.
i. chmod +r filename
ii. chmod -r filename
iii. chmod +w filename
iv. chmod -w filename
v. chmod +x filename
vi. chmod -x filename
wc filename - Counts the number of lines, words and characters
for each file.
wc -l - Counts the number of lines for each file.
man commandname - Prints the manual page on a terminal for a particular
who - Lists the users currently logged on to the system.
who am i? - Prints the current user.
OD - It interprets bytes of a computer.
OD S - Prints the decimal value of the contents of the file.
do [ disk storage ] - It tells how much space is consumed by the files and
directories including sub directories.
echo statement - Prints the line given in the statement on the output
grep pattern file - Prints the line that matches to the specified pattern.
i. grep -l pattern file - List the filenames in which there was a match of
patterns but it produces no other output.
ii. grep -n pattern file - List the line number.
iii. grep -y pattern file - Prints the line that do not match in specified stream.
iv. sort file name - Sort files alphabetically by lines.
v. sort -d filename - Sort file names in descending order.
Result :Thus the simple basic LINUX commands are studied.