Working on command line
Commands from keyboard=== operating system to perform Nowadays we got GUI in addition to CLI(command line interface ‘s) such as shell
BASH(bourne again shell ) It is advanced version of Bourne shell program sh (written by Steve Bourne) and act as a shell program. Others are there too like Eg . Ksh,tcsh and zsh
.sh—A Bash shell script .txt—A generic text file .log—A log file .html—A HTML Web page .tgz (or .tar.gz)—Compressed file archive
They are basically called “terminal emultors” They are programs that put a window up and let u interact with the shell Eg :- xterm,rxvt,konsole,genometerminal,nxterm and eterm.
Most Linux distributions include the following directories: /dev—Contains device drivers /bin and /usr/bin—Contains standard Linux commands /lib and /usr/lib—Contains standard Linux libraries /var—Contains configuration and log files /etc—Contains default configuration files /usr/local/bin—Contains commands not a part of the distribution, added by your administrator /opt—Contains commercial software /tmp—Stores temporary files /sbin and /usr/sbin—Contains system administration commands(/sbin stands for safe bin)
Pwd Print working directory i.e. The directory you are standing. Cd Change directory Cd <pathname> • If u type cd followed by nothing then it will change to home directory • Cd~user_name –change from working directory to home directory
ls :- list ls :- list the files in working directory. ls / bin :- list the files in bin directory. ls -l :-list the files in the working directory in long format ls-l/etc :-list the file in the /bin directory in long format ls-la.. :- list all files in the parent of the working directory in long format.
Commands in linux is genrally mostly operate as Command-options arguments Options-it is adjustment to the command behaviour. Arguments are one or more thing on which command operates.
It has the permission in additon to file owners
cp :- it copies files and directories cp file1 file2 cp –i file1 file2 cp file1 dir1 cp –r dir1 dir2
mv:- it performs two diffnert functions depending on its use it moves files from one directory to other or rename the file or directory mv file 1 file 2 mv –i file1 file 2 mv file 1 file2 file3 dir 1 mv dir1 dir 2
rm :-removing the file rm file1 file 2 rm –i file 1 file 2 rm –r dir 1 dir 2 Well its needed to be careful withthis one once you delete a file its gone forever.you can do damage to your system if not careful with this one
mkdir :- it is used to create directorie. [me @linuxbox me ] $ mkdir directory
Each file on system is assigned access rights for the owner of the file , the memebers of group of related users,and everybody else Rights can be assigned to read a file ,write it, and to execute it. [me@linuxbox me] $ ls –l some_file it will display like -rw-rw-r—1 me me 1097374 sep 23 18:03 some_file
The file “ some file” is owned by user “me” User “me” has the right to read and write this file. The file is owned by group “me” Members of the group “ me” can also read and write this file Everyone else can read this file
chmod :- it is used to change permission of the file or directory To use it we have to specify the setting and the files we want to modify. E.g. [me@linuxbox me]$ chmod 600 some_file Value meaning 777
(rwxrwxrwx) no restricions on permissions anybody can do anything
700
(rwx---)the files owner may read ,write ,and execute the file. Nobody else has any rights .
666
(rw-rw-rw-) all users may rad and write this file
644
(rw-r—r)the owner may read and write file.while others may only read the file
600
The owner may read and write a file .other have no rights
777 :- (rwxrwxrwx) no restrictions on permission 755 :-the directory owner has full access. 700 :-the owner has full access nobody else has any rights
[me@linuxbox me]$ su Password [root@linuxbox me]#chgrp new_group some_file
1. LINUX IS CASE-SENSITIVE. For example: Netscape, NETSCAPE and nEtscape are three different commands. Also my_filE, my_file, and my_FILE are three different files. Your user login name and password are also case sensitive. (This goes with the tradition of UNIX and the "c" programming language being case sensitive.) 2. Filenames can be up to 256 characters long and can contain letters, numbers, "." (dot), "_" (underscore), "-" (dash), plus some other not recommended characters. 3. Files with names starting with "." are normally not shown by the ls (list) or dir commands. Think of these files as "hidden". Use ls -a (list with the option "all") to see these files. 4. "/" is an equivalent to DOS "\" (root directory, meaning the parent of all other directories). 5. Under Linux, all directories appear under a single directory tree (there are no DOS-style drive letters). 6. In a configuration file, a line starting with # is a comment
hostname whoami id username who finger user_name history uptime any df –h
anycommand --help| more man topic apropos topic help command * mcopy
mount umount cdplay play 1 eject (to get a coffee holder…..) play my_file .wav mpg123 my_file.mp3 sox