Difference between revisions of "Linux commands"

From Organic Design wiki
m (fstab: W:...)
Line 34: Line 34:
  
 
==Devices==
 
==Devices==
 +
===mount===
 +
All files accessible in a Unix system are arranged in one big tree, the file hierarchy, rooted at /.  These files  can  be  spread  out over  several  devices. The mount command serves to attach the file system found on some device to the big file tree.
 +
 +
{{code|<bash>
 +
mount [device] [directory]
 +
</bash>}}
 +
 
===fstab===
 
===fstab===
 
Static information about the filesystems ('''fstab''') is a configuration file that contains information of all the partitions and storage devices in your computer. It contains information of where your partitions and storage devices should be mounted and how. See [[W:Fstab#Example]].  
 
Static information about the filesystems ('''fstab''') is a configuration file that contains information of all the partitions and storage devices in your computer. It contains information of where your partitions and storage devices should be mounted and how. See [[W:Fstab#Example]].  
Line 40: Line 47:
 
cat /etc/fstab
 
cat /etc/fstab
 
</bash>}}
 
</bash>}}
 
==mount==
 
All files accessible in a Unix system are arranged in one big tree,
 
      the file hierarchy, rooted at /.  These files  can  be  spread  out
 
      over  several  devices. The mount command serves to attach the file
 
      system found on some device to the big file tree.
 

Revision as of 09:17, 8 June 2008

I'm starting a list of useful linux shell commands (generally "one liners") we use a lot

Image Manipulation

Resizing JPG's and changing quality setting

The first line shows how to reduce and image to 25% and quality to 50% adding "_resized" to the results filename. The second command uses Perl to apply this same command to all JPG's in the current directory.

{{{1}}}

Apply an opaque background of a specified colour to a directory of transparent PNG's

  • This command requires ImageMagick to be installed
  • It loops through all PNG's in the CWD and puts them in a directory called processed which must exist
<bash>

perl -e 'qx "convert $_ -background #ff00ff -flatten foo/$_" for glob "*.png"' </bash>

See also

Network commands

Release DHCP lease

<bash>

sudo dhclient -r </bash>

Obtain a new DHCP lease

<bash>

sudo dhclient </bash>

Devices

mount

All files accessible in a Unix system are arranged in one big tree, the file hierarchy, rooted at /. These files can be spread out over several devices. The mount command serves to attach the file system found on some device to the big file tree.


<bash>

mount [device] [directory] </bash>

fstab

Static information about the filesystems (fstab) is a configuration file that contains information of all the partitions and storage devices in your computer. It contains information of where your partitions and storage devices should be mounted and how. See W:Fstab#Example.


<bash>

cat /etc/fstab </bash>