Advanced Search
Search Results
30 total results found
In Unix, what do I do when a file I want to edit in vi says "Line too long"?
In Unix, when the vi editor says “line too long” it’s usually because it was copied up from a Mac where the end of line marker is different.This command works for me on Solaris:tr '\015' '\012' < in_file > out_fileSource: http://www.maths.ox.ac.uk/help...
Unix Cheat Sheets and Tricks
While Unix is an extremely flexible, powerful, and stable operating system, mastering it can require apprenticing yourself to an expert and monitoring every keystroke. This article will hopefully grow as others add their favorite Unix tricks.The best trick is...
vi editing notes
vi is a Unix text editor that is almost always available, on any Unix or Linux system. Knowing how to edit in it means you’ll always have an editor available, for editing config files or whatever.To convert a unix text file to a windows/dos text file:%s/$/\^M/...
My hard disk is dying! How do I make an emergency backup?
Disaster has struck and your hard disk is in its final death throes. No problem, you made a backup last night, right? Of course you did… but a pipe burst and you lost your backup tapes?Assuming that you’re trying to backup a UNIX or Linux system:(if it’s Windo...
On a UNIX / Linux system, how do I view which shared libraries a program needs?
To get a list of shared libraries that a program needs:ldd /path/to/programThis will give you a list of the required shared libraries and the paths to the files that are being used for each requirement. If a file cannot be found for a particular requirement, i...
Apple OS/X Hex Editor
If you need a hex editor in OS/X to see exactly what is in a file, download this free one. http://ridiculousfish.com/hexfiend/Two other Unix commands for working with binary data are dd and od. You can read about them from their man pages: man dd man odTaken f...
How do I keep color output when paginating shell output through less?
Let’s say that you like the color output that comes out of ls (different colors for different file types). But when you have lots of files and want to paginate it through less, you lose the color output. So how do we keep the colors?You need to give the -r fla...
UNIX Tutorials
Learn UNIX in 10 minutesUNIX Tutorial for BeginnersHow To Look Like A UNIX GuruBest Practices Learn 10 Good UNIX Usage Habits Learn 10 More Good UNIX Usage Habits Three Books Every System Administrator Should Read – Matt Frye Linux Magazine -July 1st, 2009 Uni...
lsof, the least talked about Unix tool
Apparently this is one of the least talked about, but most useful Linux/Unix tools.lsof lists information about files opened by processes, and according to these articles, that is more useful than it sounds. http://dmiessler.com/study/lsof/ http://0xfe.blogspo...
Finding most recently changed files in Unix
How do I find the most recently changed files in a set of subdirectories on Unix or Linux?Answer 1: This will show the most recent 10 files in current directory and below.It supports filenames with spaces. And can be slow with lots of files http://stackoverflo...
Advantages of less over more (UNIX)
This article is intended to provided reasons to use the UNIX program less over its predicessor more.What is less?If you use the whatis program for less on a UNIX terminal you get “opposite of more”. What does this mean? more allows a user to incrementally disp...
Description and guidelines on creating system service agent accounts on Mac OS X (Tiger)
For any system service agent that you want to create in Mac OS X, you would do the following:sudo dscl localhost -create /NetInfo/root/Groups/system_groupnamesudo dscl localhost -create /NetInfo/root/Groups/system_groupname gid group_idsudo dscl localhost -cre...
Calculate Duration Between Two Dates
Using this website, you can easily calculate the number of days between two dates:http://www.timeanddate.com/date/duration.htmlYou can also use a UNIX script to do this. It can be found here:http://www.unix.com/showthread.php?t=4870
Reasons to Use Vim over Vi
This page Difference Between VIM and vi goes over some of the advantages of vim over vi. (Note: the page disappeared, so now we’re pointing at the Internet Archive’s March 2011 cached version.)To list some useful features:Multi-level History Undo – n u (n is ...
Useful Commands for Vi
The page is meant to document some of the more useful, but obscure commands in vi. For commands exclusive to vim see Reasons To Use Vim Over Vi. Please feel free to add commands you would like to see on this page. % move to matching (, {, or [ n G goto...
using find and chmod together in Unix
In Unix, if you need to clear up a set of subdirectories to see what permissions or ownership of everything under a given directory, these commands work for me on Solaris. There are differences because you don’t want to give execute permissions to files. And t...
X11 on MacBook Pros
As of August 2007, Apple made a real effort to hide X11 on Tiger install disks for MacBook Pros. It doesn’t get installed by default, and it’s not available through the installer. To get it, insert disk 1, open Terminal and run:open /Volumes/Mac\ OS\ X\ Instal...
finding words in binary files
In Unix the strings -a command will output all the text strings in a binary file.Solaris man page for strings says: “The strings utility looks for ASCII strings in a binary file. A string is any sequence of 4 or more printing characters ending with a newl...