jump to navigation

Learning Linux – Text Based Basic Commands (Bash Script) in Linux Terminal March 8, 2010

Posted by admin in : Computer Tips , trackback

Learning Linux Learning Linux   Text Based Basic Commands (Bash Script) in Linux Terminal

Learning Linux this time we will discuss the text-based Basic Commands (Bash Script) on linux terminal. Linux tutorial like this is necessary for us who want to explore Linux. even though the current commands in the Linux based text that has been a lot of GUI (Graphical User Interface) that make it easier for novice linux user, but in some linux basic commands, will be more efficient and faster if you continue to use a text command mode. Here are some text based Basic Commands (Bash Script) in the Linux terminal which will be discussed in this tutorial to learn linux.

#any_command –help
Displays help information about the use of orders. “-help” similar to the DOS command “/h”.

#sudo
Superuser Do, get root or administrator access on a regular user without having to login as root user

#ls
Viewing the contents of a file from the active directory. On linux dir command alias only in the form of the ls command. For the ls command itself is often made alias ls –color, so that at the time of the ls colors displayed in accordance with home files, usually green to execute, and so on.

#ls -al
Viewing the entire contents of a file on the active directory with hidden files, and display screen per screen.

#cd directory
Change directory. Using cd without the directory name will bring you to the home directory. And cd- will bring you to the previous directory.

#cp /source /destination
Copy a file, use cp -r to copy a directory

#mcopy /source /destination
Copying a file from / to dos filesystem.
Example mcopy a:autoexec.bat ~/junk . Use the command man mtools for similar: mdir, mcd, mren, mmove, mdel, MMD, mrd, mformat ….

#mv /source /destination
Move or rename files
ln-s source destination Create Simbolic Links, for example ln -sf /usr/X11R6/bin/XF86_SVGA /etc/X11/X, making Simbolic links from XF86_SVGA files to X

#rm /files
Deleting files

# mkdir/directory
Make a new directory

# rmdir/directory
Delete the directory that was empty

#rm -r /files
(recursive remove) Remove files, directories and subdirectories. Be careful using this command if you are logged in as root, because root can easily delete all the files on the system with the above command, no command to undelete in Linux

#more filename
To view the contents of a file, with the addition of more commands, then the contents of the file is displayed by the display screen.

#less filename
Viewing a file screen by screen, and press the “q” if you want to get out,

# pico filename
Edit a text file.

#pico -w filename
Edit a text file, with word wrap off function, very useful for editing files like /etc/fstab.

#lynx file.html
View html file or browse the net with a text mode, where the picture/ image can not be displayed, but lynx is a browser that is very fast, very useful if you only want an article without the image.

#tar -zxvf filename.tar.gz
untared a tar file and to uncompress the file (*.tar.gz or *.tgz), to put one’s way directory add option-C directory, for example tar -zxvf filename.tar.gz -C /opt (put file in the directory /opt

#tar -xvf filename.tar
untared a tar file is not compressed (*.tar).

#gunzip filename.gz
uncompress a zip file (*.gz” or *.z). by using gzip (also zip or compress) if you want to compress the file.

#bunzip2 filename.bz2
uncompress a file with format (*.bz2) with the utility “bzip2″, used on large files.

#unzip filename.zip
uncompress a file with format (*.zip) with the utility “unzip” compatible with PKZip for DOS.

#find / -name “filename”

Searching for “filename” on your computer starting with the /. The filename may contain wildcards (*,?).

#locate filename
Finding files with the string “filename”. Very easy and fast from the command above.

#talk username1
Talking with the keyboard with another user is logged on the reply of our machine (or use the talk username1@ machinename to talk to other computers). To receive an invitation conversation, type talk username2. If someone tries to talk to you and it is felt disturbing, you can use the command mesg n to reject the message. And use who or rwho command to see who is disturbing the user.

#mc
Running “Morton Commander” … uh … one that is “Midnight Commander” as a file manager, fast and good.

#telnet server
To connect our computer to other computers using TELNET protocols. Use the machine name or IP number machine, and you will get a login prompt from the machine name, enter the password, oh yes .. You also must have an account on the remote machine. Telnet will connect you with other computers and allow you to operate the machine. Telnet is not secure, all that you type into the “open text”, also with your password! Use ssh instead of telnet to access the machine remotely.

#ssh user@ipaddress
(Secure Shell) to access the other machine,

#rlogin user@ipaddress
(remote login) Connect your other kekomputer. Loginname and password, but if your account has been used, then you will get an error message in your password. Very unsafe, too, use ssh instead.

#rsh user@ipaddress
(remote shell) Another way to connect you to the remote machine. If the login name/password is used on a remote machine they will be, then your password will not apply. Idem with rlogin, replace with ssh.

#ftp user@ipaddress
Ftp to another machine, it is very useful for mengopy files to/from remote machines. Also not safe, use scp from ssh family instead.

#scp /source /destination
(secure copy) to copy files to or from another machine, for example user@ipaddress:/source /destination
minicom, Minicom program (it can be said like “Procomm/Hyperterminal for Linux”).

#./program_name
Running the program on the active directory, which is not present in your PATH

#xinit
Running X-windows server (without a windows manager).

#startx
Running X-windows server and load the default windows manager. Just like the “win” under DOS with Win3.1

#startx — :1
Running X-windows session on display next 1 (default use display 0). You can run a lot of GUI terminals simultaneously, to move between GUI use,, etc, but this will take more memory.

#xterm
(in X terminal), run X-windows terminal. To exit type exit

#xboing
(in X terminal). Very funny …., Such as games, old games … ..
gimp (in X terminal) image editor program that is very good, comparable to Adobe Photoshop, the only difference is this program free of charge.

#netscape
(in X terminal) running netscape, version at the time of this writing has reached version 4.7
netscape-display host: 0.0 (in X terminal) run netscape on the current machine and displays output on the machine named host display 0 screen 0. You must provide access to the active machine to display it on the host machine with the command xhost

#shutdown -h now
(as root) Shut down the system. Commonly used for remote shutdown. Use it to shutdown at the console (can be run by the user).

#halt
reboot (as root) Halt or reboot the machine. More simple than the above command.

#man topic
Displays a list of pages from the manual system (help) accordance with topic. Try man man. then press q to exit the viewer. Manual command info topic dilhat pages can be read by any_command –help.

#apropos topic
Displays the help manual on the topic ..

#pwd
Viewing the current working directory

#hostname
Displays the name of local host (the machine you are currently working). Use the command netconf (as root) to change the hostname of the machine, or edit file /etc/hosts

#whoami
Print your login name

#id username
Print user id (uid) or group id (gid)

#date
Print or change the date and time on the computer, for example to change the date and time to 2000-12-31 23:57 with a command: date 123123572000

#time
Seeing the amount of time for completion handled a process + other info. Do not be confused with the command date
View user who is logged on our computer.

#rwho -a
View all users logged in to reply your network. Service rwho command needs to be activated, run the setup as root to activate it.

#finger username
Viewing user information, try running; finger root

#last
Looking at the previous user has logged on the computer.

#uptime
Seeing the amount of time the use of computers by one, counting the last reboot.

#ps
(= print status) Seeing the processes run by user

#ps aux
Seeing the whole process is run, even without the terminal

#uname -a
Your kernel system information

#free
Information memory (in kilobytes).

#df -h
(= disk free) Viewing the disk usage information on the entire system (in human-readable form)

#du / -bh
(= disk usage) View detailed disk usage for each directory, starting from the root (in human form Legible).

#cat /proc/cpuinfo
Cpu info. Viewing files in / proc directory is not a real file (not real files).

#cat /proc/interrupts
Seeing interrupt address is used.

#cat /proc/version
View version of Linux and other information.

#cat /proc/filesystems
Viewing filesystem used.

#cat /etc/printcap
Viewing printer set

#lsmod (as root)
Looking at the kernel modules that have been loaded.

I hope this tutorial useful for you. Thanks.

If you enjoyed this post, make sure you subscribe to my RSS feed!

Comments»

1. Will the 2012 end of world myth be the most wide spread in years? | Survive December 21 2012 - March 9, 2010

[...] Learning Linux – Text Based Basic Commands (Bash Script) in Linux Terminal | ICT Learning [...]



Recent Search:
  bash script copy dir und zip (2)  bash script password response (2)  text based internet linux (2)  midnight commander morton commander (2)  script linux (2)  learning bash (2)  how to browse text based internet in linux (2)  linux terminal scripting (2)  linux terminal copy text keyboard (1)  linux kommander run script (1)