Previous Page | Next Page

  1. Agustin's Linux Manual
  2. System Administration
  3. About the Author
  4. Contents
  5. Administration
  6. Terminals
  7. Command Basics
  8. Root Directory
  9. Executing Commands
  10. File specs
  11. File Permission
  12. How permissions are assigned
  13. Change ownership chown
  14. Running multiple commands
  15. Killing Processes
  16. Bash configuration files
  17. VI Editor
  18. Creating path environment
  19. Midnight Commander
  20. Linuxconf Utility
  21. Networking
  22. Domain Name Service DNS
  23. Router and Gateway
  24. Adding Users
  25. User Accounts
  26. Managing Groups
  27. Mounting File System
  28. NFS Mounts
  29. Disk Quotas
  30. Run levels
  31. Linuxconf Control
  32. Mandrake Control Center
  33. Creating a Boot Disk
  34. Switching Boot Mode
  35. Hardware Configurations
  36. Printer Configuration
  37. Installing Printers
  38. Samba Printer
  39. Managing services
  40. Managing Users
  41. Program Scheduler
  42. Software Management
  43. Installing CUPS

Running multiple commands

When you become more familiar with the command line, you probably will need to run multiple commands. The shell let's you insert special queuing characters between commands. Here is how it is done.

[user1@server2 collections]$ command1 ; command2

The command is executed in the order it was written, but command 2 is executed even if there was an error in command 1.

[user1@server2 collections]$ command1 && command2

The command command2 is executed only if command1 was successful, no errors.

Note. You can write more than just two commands…

Multiple Virtual Terminals

Now if you really want to get fancy and execute all that you have learned…you can work on several virtual terminals or consoles. For example you might want to leave one process running in one terminal while you keep working in a different one. These terminals are called /tty1 through /tty7.

Your graphical interface normally runs on terminal seven also known as vt7 even though you are logged into a tty#.

When you execute startx you are automatically ported to vt7. By pressing the combination ATL key and any of the F1 through F7, you are switched to a different terminal, no matter if you are on your desktop.

If you are on a terminal, and you are also running the graphical interface, you can get back to your desktop by pressing, ALT & F7.

All commands you have been typing so far are running in terminal mode, which means that if you close the terminal, all the processes under that term are terminated. However on the same terminal you can run commands in the background and release the terminal for a new task.

So this is how it is done, all you have to do is place & right after command:

[user1@server2 user1]$Command &

To see which jobs have been sent to the background, type jobs at the prompt.

[user1@server2 user1]$ jobs [1]+ Running application &

Keep in mind that some commands requires super user in order to run.