Hey guys,
I will explain How to study basic UNIX/Linux commands.
To study the basics of UNIX/Linux.
To study UNIX/Linux system administration commands.
A PC with UNIX or Linux Operating system installed.
UNIX is a very powerful operating system offering many facilities, for networking as well as for programming. As it has been in the picture since the last many years, it's fully tested in almost all kinds of scenarios. it's a stable OS.
On the order hand, Linux is derived for UNIX (also called a son of UNIX) and is free to use.
Special features like an inbuilt compiler for programmers all network servers including mail system, database server, multimedia applications, applications for office use, and most exciting is that all these at free of cost makes Linux, a choice of millions now a days. many companies have started offering Pc with preloaded.
Once you learn UNIX, it's easy to learn Linux. in fact there is much more in Linux compared to UNIX. as there are thousands of programmers working on the Linux kernel, willing to give something new, every day. You can visit www. Linux.org and find updates for download.
UNIX/Linux commands-
Be careful that all the commands in UNIX/Linux are case-sensitive.
clear: It is like "cls" in DOS, it clears the screen.
ls: It gives the list of files in the directory you are working. There are many options with is a command.
some of them are:
ls | more Gives the list page-wise.
ls - l Displays the list of files with permission, data, size.
ls - la Displays the list of files, including hidden files.
pwd: It shows the present working directory, in which you are working.
mkdir: make the directory.
E.g. mkdir abc will make the new directory abc, in the present directory.
rmdir: delete a directory.
E.g rmdir abc will remove directory abc.
touch: Creates a blank file. You can also create a file using vi editor, but this command is helpful to programmers, to immediately create a blank file.
E.g. touch xyz will create a blank file xyz.
rm: delete a file.
Option "r" used with the "rm" commands can delete a directory tree.
E.g. rm -r abc will remove all the files and directories under abc i.e.recursive
delete.
mv: Move a file.
E.g. mv/etc/abc/mnt/floppy
will move the file abc from etc directory to floppy under mnt directory. the same command can be used for renaming the file also, so be careful while using the command.
useradd: Will add a user, also creates a home directory under /export/home or in some UNIX flavors, under /home, without setting a password for it.
Linux will also add the group by the name of the user and add that user to this group. The user ID will be given starting from 500. user ID for the root user is 0, which is the most powerful account on a UNIX system. after adding a users password should be changed for that new user, by the root user, otherwise the user can not log in.
There is a long syntax to follow for the useradd command, for setting shell, password, account expiry, and other parameters. but it's not mandatory to follow.
passwd: Change password. if a root user uses this command he can change the password for itself or other users too. if used by a common user, he/she can change the password for self, not for the other users.
E.g. If you are logged in with root user.
passwd
The system will ask for a new password, twice and change the password for root user.
If you as a root user, use other users name
E.g.passwd user1
Then the system will respond with a new password, this is helpful incase a user forgets the password than root user can change their password. But one normal user who is not an administrator or root user can change the password for him only.
cat: displays contents of the file.
E.g. cat myfile.txt
cp: copy file from a given source directory to a destination directory.
cp/home/use1/* /home/user2
will copy all file from user1's home directory to the home directory of user2.
mount: mount removable devices to the directory specified. A directory must exist before mounting.
E.g mount/dev/fd0/mnt/floppy
will mount the device /dev/fd0 to the directory/mnt/floppy
Before removing the floppy it must be unmounted.
Like unmount /dev/fd0, notice that only device name required while unmounting.
