Hot answers tagged osx
If you don't want to be challenged every time for your password then I'd recommend setting it to NOPASSWD in your /etc/sudoers file rather than hardcode your password in your logins. At least this way your primary login's password will remain intact and not be completely exposed in your .bashrc. To make this change run the command sudo visudo, and change ...
If the filesystem takes over the whole disk, OS X currently uses a name like /dev/disk5. If the disk is partitioned, it adds an s# suffix, like /dev/disk5s2 for the second partition. (s is short for "slice," a BSDism functionally equivalent to a partition.) Disks are numbered sequentially in discovery order by the OS, on boot, so you may have to experiment ...
To my knowledge /dev/shm is a Linux-only feature. I just doubled checked on my OSX 10.9.4 system and it definitely does not have /dev/shm. Now given OSX is rooted in Unix I would be very surprised if it did not have something similar, so searching for the equivalent led me to this SO Q&A titled: Does OS X have an equivalent to /dev/shm?, which in turn ...
I started using @Gilles's answer, but found that if the terminal changed the number of columns the prompt would no longer be at the start of a line as expected. This can happen for a variety of reasons, including tmux/screen splits, manual resizing of a GUI container, font changes, etc. What I really wanted was something that would add a newline if the ...
I found this tutorial. It's untested by me but several commenters to the article attested to it working. The article is titled: Mount a ufs2 Volume in MacOS/X 10.7 (Lion). excerpt If you have to mount an ufs2 volume (for example an external FreeNAS disk) in MacOS/X Lion, you can do the following: Download and install OSXFUSE from ...
The -i switch causes sed to edit the original file. That means there is no output and since there is no output, your redirection results in an empty file. So, what you want is either sed -i '' 's/$/<@string>/' txt.txt which will change the original txt.txt. Or, just sed 's/$/<@string>/' txt.txt > txt2.txt
If you insert echo "prevexit=3" > ~/.prevexit at the end of your crontab initiated command, then you can use: source ~/.prevexit close to the top of all the scripts that need to include the value, and use it in the rest of those scripts as $prevexit. You should of course replace 3 with the real value you want to share.
The description in Wikipedia is quite clear: .DS_Store (short for Desktop Services Store)1 is a hidden file with a proprietary format created by OS X to store custom attributes of a folder such as the position of icons or the choice of a background image
No general-purpose filesystem uses beginning-of-file or end-of-file sequences. They would be extremely impractical: what if a file contains these character sequences? Most basic filesystems divide the storage into fixed-size blocks, and maintain a list of blocks for each file. The file size is kept separately, and how much of the last, partial block is used ...
Try moving [[ $TERM != "screen" ]] && exec tmux to your .zshrc file. That way the command will only be run in interactive shells. An interactive shell is simply any shell process that you use to type commands, and get back output from those commands. That is, a shell with which you interact.
When grepping a disk - unless you're actually looking for non-printable information - you might like to do: tr -c '[:print:]\n' '\n\n' </dev/disk | grep -b 'regex' All binary data is converted to newlines and grep can simply ignore it except to increment the offset it reports on by one.
Installation of ruby can be easily done using curl: curl -sSL https://get.rvm.io | bash and is listed in the main rvm site here. After this operation is complete type rvm in the command line to check if it installed properly and if it did, it lists out its usage and other things. Ruby is usually pre-installed in most linux ditributions. To check ...
Add alias ll='ls -lG' to your ~/.profile with your favorite $EDITOR. With this method, remember that you'll have to start a new terminal session (or source ~/.profile to be able to use ll).
Yes, OS X is UNIX. "UNIX" is really just a trademarked name, applied by The Open Group, upon completion of a certification. Many different - not at all compatible - OSes are certified as a UNIX. OS X among them. Here is the current certification page for OS X 10.9 "Mavericks" as "UNIX 03" certified: ...
Only top voted, non community-wiki answers of a minimum length are eligible