|
|
Must-have Terminal commands
|
|
|
|
Professional Poster
Join Date: Mar 2002
Location: adequate, thanks.
Status:
Offline
|
|
I was just configuring my MacBook when I thought that I really have too less knowledge about what can be achieved with the Terminal.
I know there are several cleaning/maintenance routines that can/should be performed from time to time via the Terminal somethink with daily/weekly etc.).
Then I know that command to make the Terminal transparent, which just looks cool: defaults write com.apple.Terminal TerminalOpaqueness [value]
Then I knew that command to check battery capacity, but that one doesn't work with my MacBook anymore… ioreg -l | grep -i IOBatteryInfo
What commands are you using on a regual basis that you have found to be usefull? I know they are scattered all over the forum and the internet, but a dedicated thread wouldn't be harmful, I guess.
EDIT: I honestly didn't know about the UNIX forum…
(
Last edited by andreas_g4; May 28, 2006 at 04:30 PM.
)
|
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: Jan 2001
Location: The Sar Chasm
Status:
Offline
|
|
kill.
sudo shutown -r now.
w.
ssh.
top.
I'm not a big CLI guy, but those come in handy all the time.
|
When a true genius appears in the world you may know him by this sign, that the dunces are all in confederacy against him. -- Jonathan Swift.
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Now that Finder searching is all Spotlight, all the time, I find myself using find and locate a lot more.
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Oct 2000
Location: Seattle
Status:
Offline
|
|
I use a few things all the time
mv to move files around
cp to copy files
- used with sudo you can handle files among multiple users
ls -l to list a folder's contents
cat to look at the contents
| (vertical bar) will take the results of one command and "pipe" them into another
so
cat filename | less
gives you a way to read a file and scroll up and down
head and tail will give you the beginning and end of a file - useful for looking at log files
tar, gzip, gunzip, bzip and bunzip for compression and archiving
top will show you what is running and memory usage in real time (more or less) - hit q to quit
ps ax gives you a list of processes
ifconfig - shows the network interface settings
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULT ICAST> mtu 1500
inet 192.168.1.100 netmask 0xffffff00 broadcast 192.168.1.255
this tells me my IP Address is 192.168.1.100
ll /var/log
tail /var/log/system.log
|
You can take the dude out of So Cal, but you can't take the dude outta the dude, dude!
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
You can just use less filename to read a file.
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Jun 2003
Location: Newport News, VA USA
Status:
Offline
|
|
FYI - Terminal transparency can be set directly in Terminal's Window Settings (Terminal menu -> Window Settings... -> select Color from the drop-down menu) now - since Panther, I think.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Jun 2003
Location: Newport News, VA USA
Status:
Offline
|
|
Originally Posted by Chuckit
You can just use less filename to read a file.
You can also use zless and zmore to read compressed files (like the log files in /var/log that end in .gz) without un-archiving them first.
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Dec 2001
Location: Bolton, UK
Status:
Offline
|
|
In Tiger, you don't need to run the maintenance scripts from the terminal. They are run automatically by launchd.
|
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Jan 1999
Location: Marietta, GA, USA
Status:
Offline
|
|
Originally Posted by andreas_g4
Then I know that command to make the Terminal transparent, which just looks cool: defaults write com.apple.Terminal TerminalOpaqueness [value]
You can also just use the Window Settings menu item... (look under the Color options).
-Scott
EDIT: Doh! I just saw that someone already posted that. I really did look at the posts first. It's late, I'm tired, etc... OK, to make up for it, check this site for lot's of good tips:
http://www.cs.cmu.edu/~benhdj/Mac/unix.html
|
Scott Genevish
scott AT genevish DOT org
|
|
|
|
|
|
|
|
Junior Member
Join Date: Nov 2001
Location: Seattle
Status:
Offline
|
|
More useful commands:
grep -- search through files
open -- open something as if you had double clicked it
curl -- for downloading stuff
cal -- displays a calendar
uptime -- shows how long your computer has been running
man -- gives syntax/usage for commands
vi/vim -- for editing text files (great after you get past the steep learning curve)
pico -- good for quick edits if you don't want to learn vi
gcc/g++ -- compile your own programs!
|
|
|
|
|
|
|
|
|
Junior Member
Join Date: Jun 2005
Status:
Offline
|
|
find - find files by permissions, owner, group, etc. very useful if you want to remove a certain type of file on your system. i.e. find / -name core -exec rm {} \; will remove all of the core files from your system
df - display disk utilization by mounted disk. df -k will display in KB the total and used space of mounted file systems.
du - very useful to find the files eating up your disk space. du -sk * in any given directory will give you the amount of space in kb each file takes. In the event of a directory, it will traverse the file structure and tell you the total space of all files beneath the directory.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Oct 2000
Location: Oakland, CA
Status:
Offline
|
|
For me...
alias (custom profile commands)
ls -la -G (my alias for ls)
grep
vi
man
curl
ssh
sudo
> (i.e. ls > filename) Save as a text file
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Jan 2003
Location: 127.0.0.1
Status:
Offline
|
|
Check out CLIX. There are many, many different CLIX databases for just about everything you could think of. You can even add your own commands.
That said, my favorite is...
sudo find / \( -name *.lproj -and \! \( -name English.lproj -or -name en.lproj \) \) -exec rm -rf \{\} \;
|
|
|
|
|
|
|
|
|
Registered User
Join Date: Apr 2000
Status:
Offline
|
|
My most used commands off the top of my head:
locate
ssh
scp
uptime
top
ps
ifconfig
clear
less
grep
awk
curl/wget
nano
ls/mv/cp/rm/cd
|
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Oct 2001
Location: Australia
Status:
Offline
|
|
Can someone kindly provide me the terminal commands for performing the crons.I want to peform them for maintence since i got rid of the app that does this.
(
Last edited by Rob van dam; Jun 25, 2006 at 01:49 AM.
)
|
Apple an innovator in a world of Immitators.
And thats the bottom line!!!!!!!!!
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Jun 2006
Status:
Offline
|
|
You mean
sudo periodic daily (or weekly or monthly) ?
|
Moe
1.66GHz Core-Duo Mini, 2GB/120GB, Apple 23" Cinema HD Display
Apple Wireless Keyboard & Mouse, Apple iSight Camera
Apple USB Modem (for faxing), Bose Companion 2 Speakers
2.0GHz white MacBook 1GB/80GB
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Oct 2001
Location: Australia
Status:
Offline
|
|
Originally Posted by MiniMoe
You mean
sudo periodic daily (or weekly or monthly) ?
Its something along those lines.Im still not sure if tiger does it on its on.I just want to enter it manually and do this periodically.
|
Apple an innovator in a world of Immitators.
And thats the bottom line!!!!!!!!!
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Oct 2000
Location: Los Angeles
Status:
Offline
|
|
The OS does cron automatically, and Tiger does not miss the schedule due to sleep or shutdown.
|
"The natural progress of things is for liberty to yield and government to gain ground." TJ
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
rsync
scp
wget (you can install this over DarwinPorts)
ClusterSSH is a very cool app
|
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Oct 2000
Status:
Offline
|
|
"screen" for having multiple crash-safe terminals in one window
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|