Advance+ Support

Documents For Advance User and Developers;

Before Start, Here İs Basic Linux Commands For Beginners;

Viewing, copying, moving and deleting files

ls Display the contents of the current directory
ls -a Display also hidden files and hidden directories
cp filename /path/dir_name Copy filename into directory /path/dir_name
cp -r dir_name /path/dir_name2 Copy the entire dir_name into /path/dir_name2
cp filename1 filename2 /path/dir_name Copy filename1 and filename2 into /path/dir_name
rm name Remove a file or directory called name
rm -r name Remove an entire directory as well as its included files and subdirectories
mv filename /path/dir_name Move filename into /path/dir_name
mv filename1 filename2 Rename filename1 to filename2
cat filename Display filenames contents
more filename Display filename in pages. Use spacebar to view next page
head filename Display filenames first 10 lines
head -15 filename Display filenames first 15 lines
tail filename Display filenames last 10 lines
tail -15 filename Display filenames last 15 lines
pwd Display current directory
cd /path/dir_name Change to directory /path/dir_name
cd .. Go 1 directory up
mkdir dir_name Create directory dir_name
rmdir dir_name Delete directory dir_name

Finding files and text within files

updatedb Update (create first time used) a database of all files under the root directory /
locate filename Find file filename searching in the database
find / -name filename Starting from the root directory search for the file called filename
find / -name *filename Same as above but search for file containing the string filename
grep string /path/dir_name Starting from /path/dir_name search for all files containing string
which application_name Search $path for application app_name
whereis application_name Search $path, man pages and source files for application_name

Archived files

Decompress

tar -xzf filename.tgz Decompress tzg file
tar -xzf filename.tar.gz Decompress tar.gz file
tar -xjf filename.tar.bz2 Decompress tar.bz2 file

Compress

tar -czf filename.tar /path/dir_name Compress directory /path/dir_name to filename.tar
gzip -c filename > filename.gz Compress /path/dir_name to filename.tar.gz
bzip2 -c filename > filename.bz2 Compress /path/dir_name to filename.tar.bz2

Using rpm files

rpm -hiv package.rpm Install rpm called package.rpm
rpm -hiv –force package.rpm Install rpm called package.rpm by force
rpm -hUv package.rpm Upgrade rpm called package.rpm
rpm -e package.rpm Delete rpm called package.rpm
rpm -qpil package.rpm List files in not-installed rpm called package.rpm
rpm -ql package.rpm List files in installed rpm called package.rpm
rpm -q str List installed rpms containing the string str
rpm -qf /path/application_name Display the rpm that contains application application_name

Starting and Stoping

startx Start the X system
shutdown -h now Shutdown the system now and do not reboot
halt
Same as above
shutdown -r now Reboot
reboot Same as above
shutdown -r +10 Reboot in 10 minutes

Mounting filesystems

mount -t vfat /dev/sd(a)(1) /mnt/c_drive Mount the first partition 1 of the first hard disk drive a which is in fat32 vfat dormat under /mnt/c_drive directory
mount -t iso9660 /dev/cdrom /mnt/cdrom Mount cdrom under /mnt/cdrom directory
umount /mnt/hda1 Unmout the above

User administration

users Display users currently logged in
adduser username Create a new user called username
passwd username Define password for user called username
who List logged-in users
whoami Display current user
finger username Displays info about user username
su Log in as root from current login
su - Log in as root from current login and take root’s path
exit Exit from console login (ie, logout).

Processes

command Execute command in the foreground
command & Execute command in the background
ctrl+z Suspend a program
ctrl+c Interrupt a program
ps List all processes
kill -9 pid Kill process with id pid
top Monitor processes in real time

Networking

hostname List the system’s hostname
ifconfig Set/Display network information
host ip Resolves ip’s hostname
ping ip/hostname Check if ip/hostname is reachable
traceroute ip/hostname Find network path to ip/hostname

System Information

uname -a General system information
fdisk -l List partition tables
cp filename /path/dir_name Copy filename into directory /path/dir_name
df -T -h List filesystem disk space usage
lspci List PCI devices
lsusb List USB devices
free -m Display RAM+Swap usage

Program Compile

gcc -o output file.c Compile a C program
./output Run a C program you have compiled
g++ -o output file.cpp Compile a C++ program
./output Run a C++ program you have compiled
./configure && make && su -c ‘make install’ Configure, compile and install a program with Makefile

From : http://www.my-guides.net/en/content/view/29/26/

Command Example Description
cat Sends file contents to standard output. This is a way to list the contents of short files to the screen. It works well with piping.
cat .bashrc Sends the contents of the “.bashrc” file to the screen.
cd Change directory
cd /home Change the current working directory to /home. The ‘/’ indicates relative to root, and no matter what directory you are in when you execute this command, the directory will be changed to “/home”.
cd httpd Change the current working directory to httpd, relative to the current location which is “/home”. The full path of the new working directory is “/home/httpd”.
cd .. Move to the parent directory of the current directory. This command will make the current working directory “/home.
cd ~ Move to the user’s home directory which is “/home/username”. The ‘~’ indicates the users home directory.
cp Copy files
cp myfile yourfile Copy the files “myfile” to the file “yourfile” in the current working directory. This command will create the file “yourfile” if it doesn’t exist. It will normally overwrite it without warning if it exists.
cp -i myfile yourfile With the “-i” option, if the file “yourfile” exists, you will be prompted before it is overwritten.
cp -i /data/myfile . Copy the file “/data/myfile” to the current working directory and name it “myfile”. Prompt before overwriting the file.
cp -dpr srcdir destdir Copy all files from the directory “srcdir” to the directory “destdir” preserving links (-p option), file attributes (-p option), and copy recursively (-r option). With these options, a directory and all it contents can be copied to another directory.
dd dd if=/dev/hdb1 of=/backup/ Disk duplicate. The man page says this command is to “Convert and copy a file”, but although used by more advanced users, it can be a very handy command. The “if” means input file, “of” means output file.
df Show the amount of disk space used on each mounted filesystem.
less less textfile Similar to the more command, but the user can page up and down through the file. The example displays the contents of textfile.
ln Creates a symbolic link to a file.
ln -s test symlink Creates a symbolic link named symlink that points to the file test Typing “ls -i test symlink” will show the two files are different with different inodes. Typing “ls -l test symlink” will show that symlink points to the file test.
locate A fast database driven file locator.
slocate -u This command builds the slocate database. It will take several minutes to complete this command. This command must be used before searching for files, however cron runs this command periodically on most systems.
locate whereis Lists all files whose names contain the string “whereis”.
logout Logs the current user off the system.
ls List files
ls List files in the current working directory except those starting with . and only show the file name.
ls -al List all files in the current working directory in long listing format showing permissions, ownership, size, and time and date stamp
more Allows file contents or piped output to be sent to the screen one page at a time.
more /etc/profile Lists the contents of the “/etc/profile” file to the screen one page at a time.
ls -al |more Performs a directory listing of all files and pipes the output of the listing through more. If the directory listing is longer than a page, it will be listed one page at a time.
mv Move or rename files
mv -i myfile yourfile Move the file from “myfile” to “yourfile”. This effectively changes the name of “myfile” to “yourfile”.
mv -i /data/myfile . Move the file from “myfile” from the directory “/data” to the current working directory.
pwd Show the name of the current working directory
more /etc/profile Lists the contents of the “/etc/profile” file to the screen one page at a time.
shutdown Shuts the system down.
shutdown -h now Shuts the system down to halt immediately.
shutdown -r now Shuts the system down immediately and the system reboots.
whereis Show where the binary, source and manual page files are for a command
whereis ls Locates binaries and manual pages for the ls command.

Editors: emacs, vi, pico, jed, vim

From : http://www.comptechdoc.org/os/linux/usersguide/linux_ugbasics.html

Also you can find more documents here;

 

http://code.google.com/intl/tr/edu/tools101/linux/basics.html

VN:F [1.9.22_1171]
Rating: 10.0/10 (2 votes cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)
Advance+ Supportİleri Seviye Destek, 10.0 out of 10 based on 2 ratings

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>