Difference between revisions of "Linux commands"
(add link to unix docs) |
(→Network commands: netstat -lp) |
||
Line 40: | Line 40: | ||
== Network commands == | == Network commands == | ||
+ | |||
+ | === Restart the network after changing configuration === | ||
+ | {{code|<bash> | ||
+ | sudo /etc/init.d/networking restart | ||
+ | </bash>}} | ||
+ | |||
+ | === List all the listening sockets and their ports and programs === | ||
+ | {{code|<bash> | ||
+ | sudo netstat -lp | ||
+ | </bash>}} | ||
=== Release DHCP lease === | === Release DHCP lease === |
Revision as of 10:42, 13 January 2009
Files
Get the size of a directory and its contents
Search and replace content in files
You could also use find and sed, but I find that this little line of perl works nicely.
- -e means execute the following line of code.
- -i means edit in-place
- -w write warnings
- -p loop
EXTS="7z t7z"
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.
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
See also
- Converting_microarray_images for bash/imagemagick image file manipulation
Network commands
Restart the network after changing configuration
List all the listening sockets and their ports and programs
Release DHCP lease
Obtain a new DHCP lease
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.
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 is a map of devices to the point in the filesytem where the device can be accessed, it contains information of where your partitions and storage devices should be mounted and how. It acts as a set of defaults for devices that are specified using the mount command where the file system directory is not specified. See W:Fstab#Example.
Mount a .iso
See this HOWTO