Saltar al contingut Saltar a navegacio
Map
  • Home
  • Information
  • Contact
  • Map

Linux Working Environment



F: Drive

The account that you see on a PC will be the same for both Windows and Linux. This account corresponds to the disk space that you have on the PC network server. While on Windows you can just access this space at the F: drive, on Linux you will have the directory $HOME.

The home directory of the Linux session is where the usual Unix configuration files are created and saved (.login, .emacs…) When you open a new session you will be in this directory and you may access the rest of your account by moving upwards in the directory tree (cd ..). Do not remove this directory or you will have problemas accessing Linux!


Commands


Due to the limitations of the SMB protocol (the one Windows uses to communicate with the file server) the file system where you see your account does not behave the same way other Unix system would.

More specifically, in your account you will not be able to use the chmod or chown commands or make symbolic links.

Remember that, even though you are accessing your account from Linux, the space you can use is limited. You can check your quota with the quota command. If you need temporary space you can use the directory /tmp during your current session, but its content will disappear when you reboot the PC.

To change your password you must use the option 'Canviar Password', in the Racó. Remember that the inLab FIB servers work with a single sign-on, which means that in the Racó you will change your password for all the machines you have access to.

Disketts and CD-ROM

Floppy disks can be accessed under the directory /media/floppy.

When using floppy disks under Linux, you must be very careful to work with them properly because otherwise you may damage them. The correct way to access the floppy disk drive is:

  • Put the diskette in the drive.
  • Enter the command mount /media/floppy.
  • Work with the diskette (using /media/floppy).
  • BEFORE you remove the diskette, enter the command umount /media/floppy.
  • Remove the diskette.

To access CD-ROMs (on the computers that have a CD-ROM drive), you will have to mount them with the command mount /media/cdrom and they will be accessible using the directory /media/cdrom. In order to remove them, you must unmount them with the command umount /media/cdrom.

USB devices can be mounted with the command mount /media/usb. It is important not to remove these devices from the USB port while they are in use. To unmount them, use the command umount /media/usb.


Communications

For security reasons no telnet or ftp connections can be made between the PCs in the classrooms.

If you want to access the inLab FIB Unix servers, make sure you DO NOT use telnet.

Instead of telnet use the command ssh (Secure Shell), which has many advantages, including encryption of network traffic (and therefore your password) and transparent configuration of the X environment of the new session.

The basic syntax of SSH is:

> ssh server -l username

As you would know, the text format is different between these two systems. You can change from one format to the other with the commands dos2unix, unix2dos, unix2win and win2unix.The Linux vi editor automatically distinguishes between these two formats.

The differences are:

  • Unix uses iso-latin-1 characters and separates the lines with the CR (carriage return) character.
  • Windows also uses iso-latin-1 but it separates the lines with a NL (new line) and a CR.
  • DOS uses the cp850 characters and the line break is NL/CR.

Printers

You can access the same printers that are available on the other systems. In order to use them, follow the instructions on printing under Unix.

KDE

The Linux system currently installed has the kde window manager.


Frequently asked questions

Q. The graphical environment does not start up in Linux and I get some errors when loading the network and other services.
A. Restart the machine by pressing CTRL-ALT-DEL and reload Linux. If the problem persists, contact Operations Services.

Q. How can I print from Linux/Unix?
A. There are two ways to send documents for printing. You can do this from within an application by choosing the printer (laser_a5, laser_c6 or cpet) or else from the terminal with the lpr command:$ lpr -Plaser_a5 filename will print the file to laser_a5 in building A5 $ lpr -Plaser_c6 filename will print the file to laser_c6 in building C6.

Q. How can I check the status of the print queue?
A. With the command lpq $ lpq -Plaser_a5 will give the status of the queue of laser_a5 in building A5 $ lpq -Plaser_c6 will give the status of the queue of laser_c6 in building C6.

Q. How can I delete a job from the queue?
A. First you need to check the queue where the job has been sent to with the command lpq. You need to note down the number of the job to delete and then enter:$ lprm -pnom_cua num_job You can delete more than one job at a time by putting spaces between the job numbers that you wish to remove. To remove all the jobs at once, enter:$ lprm -Pnom_cua -

Q. Which editors are available in Linux?
A. The vi editor, which is built into Unix, and also nedi, joe and emacs. In the X Window System graphical environment there are also xedit, kate and kwrite.

Q. I am working with the emacs/vi editor and when I try to save, I get a message that I don’t have enough disk space quota to do this. How can I solve this problem?
A. Press <Ctrl>-Z, which will put the editor process into the background. Next, remove files from your account that are not necessary using the rm command. Then execute the jobs command in order to find out the number of the editor process that you left running in the background. Entering fg %<process_number> will return you to the editor.

Q. How can I exit vi without saving?
A. With :q!

Q. How can I see all the processes that I have created including those that have hung or are not assigned to any terminal?
A.$ ps -fu <username>

Q. What can I do to “kill” my processes?
A. First, enter:$ ps -fu <username>.You will see a list of processes and their associated PIDs. To eliminate any of them, you just have to use:$ kill -9 <PID number>

Q. How can I execute a command in the background?
A.$ <command_name> &

Q. I have compiled a program and I have the executable but I cannot run it. I get “command not found”. I have given it execute permission with the chmod command. What is wrong?
A. The problem is that your executable is not in a directory defined in the path variable. What you need to do to execute it is to change the path so that it includes the directory where you have your executable, or else use the following:$ ./<executable_name> This indicates that you wish to run the file located in the current directory.

Q. How can I change the path?
A. In the tcsh shell > setenv PATH "paths:separated:by:colons" In the bash shell > PATH="paths:separated:by:colons" In the above commands you can use $PATH to reference the previous value of the variable.

Q. What is the command for changing my password?
A. To change your password for all systems use the option in the Racó de l'Estudiant. It is very important that the password is 8 characters long and that it does not contain any spaces. You can also change it in the Windows environment by pressing CTRL-ALT-DEL and choosing “Change password”

Q. What is the command for finding out how much disk space quota is available?
A. In Unix:$ quota –v In Linux and in Windows you can see this with the shortcut that is on the desktop. You can also check the quota from any environment by going to the Racó de l'Estudiant.

Q. I have run out of disk space quota. Can you increase my quota?
A. In principle, the disk quotas are not increased. Only students working on their final thesis who need an increase may obtain one. The student’s final thesis supervisor must send an email to the address inlab@fib.upc.edu specifying why the student neds an increase. You must check that unnecessary items are not using up space. You can check, for example, that your browser cache is pointing to a temporary directory instead of to your personal account.

Q. Is there a directory where I can store some files temporarily?
A. Yes, on the inLab Unix machines there is the directory /tmp_users, which is deleted every night. Try to remove your files as soon as you do not need them any more to leave space for other students. Remember that you may not put files in the /tmp or /var/tmp directories of any inLab Unix system. In Linux you may use /tmp and in Windows \\Temp.In both of these directories, the information will be deleted when you reboot the machine.

Q. What debuggers are installed on the Unix machines?
A. gdb and ddd.

Q. I have been given a file with the .tar extension. How can I extract the information?
A.$ tar -tvf <file.tar> to see the content $ tar -xvf <file.tar> to extract the content. You can use wildcard characters such as * i and ?.

Q. What is the command to decompress the files with the extension .gz?
A. $ gunzip <file.gz> or else $ gzip -d <file.gz>

Q. What is the command to decompress files with the extension .bz2?
A.$ bunzip2 <file.bz2>

Q. Can I compress files in Unix/Linux to save disk space?
A. Yes, with gzip, which generates files with the extension .gz, or else with bzip2, which generates files with the extension .bz2.For more information see the man for these commands.

Q. Is there any way to capture everything that comes out on the terminal and save it into a file?
A. Yes, by executing the command $ script <file_name>.To deactivate it, press <Ctrl>-D

Q. How can I mount a USB device in Linux?
A. To mount a USB device such as a flash drive, you need to connect it and mount it with the shortcut that is on the desktop.
Compartir

 
logo FIB © Barcelona school of informatics - Contact - RSS