Tag Info

Hot answers tagged

31

From man man: To get a plain text version of a man page, without backspaces and underscores, try # man foo | col -b > foo.mantxt man prints formatted version of man page, underscores and double letters are parsed Its not so much that they are 'parsed' but rather "if you don't have a terminal, bold format is to be displayed as a repeated ...


22

Once upon a time, computers were routinely hooked up to teletypes (teleprinters) which would print all text on paper in real time as it was received. Although teleprinters didn't have any facilities for underlined or bold-faced text, outputting an underline, backspacing, and printing something else would cause that something else to appear underlined. ...


16

Mateusz's answer is correct, but it is worth pointing out that rather than stripping out formatting intended for a tty, you can have man format differently. For example, you can get a nicely formatted pdf instead with: man -t ls | pstopdf -i -o ~/ls.pdf


11

This should help identify what is going on in Johnny's answer, as well as answer the question of why this works on Linux but not Mac. The problem lies in the fact that Mac OS X uses bsdtar, whereas most Linux systems use gnutar. You can install gnutar on a Mac with Homebrew, using brew install gnu-tar, which will symlink gnutar into /usr/local/bin as gtar. ...


6

Turns out the OS X tar utility was the correct one! There was indeed an error in the archive. This email thread discusses it in more detail, but the problem is that there is a duplicate file in the archive. The SCIP guys are fixing the archive as I type this. [edit] The newly updated scip-3.2.0.tgz is now extracting just fine! The SHA-1 hash of the new tgz ...


6

The existence of a duplicate file in the archive should not make it invalid or unable to be extracted on OSX, as by default, tar overwrites duplicates. So, I'm a little confused by the behavior in your Gist - OSX tar allows for duplicate files in an archive (a throwback to its original purpose as a tape archive utility, so it allows files to be appended to ...


5

My first thought was that ImageMagick is bound to have something for this, and indeed it does. You could run something like this find . -name "*.JPG" -exec identify {} \; | grep Corrupt where you can replace . with your directory of choice (it will descend recursively) to check each file or image with ImageMagick's identify command. Grepping for 'Corrupt' ...


4

As an alternative, I have the following shell function defined (called from Oh-my-ZSH's OS X plugin): man-preview () { man -t "$@" | open -f -a /Applications/Preview.app } This results in the desired man page being opened in Preview with all the pretty formatting one could desire. It's easy enough to add this single alias to your ~/.profile (I think ...


2

You're missing the initial line of your script file - the "shebang". Put the following in your script file: #!/bin/sh CX_LICENSE=LS open -n /Applications/Inspire\ Designer\ 10.0\ GA/Inspire\ Designer.app/ That should work - the file you had before did not have enough information to tell the operating system how to run your script. You want to run a set ...


2

Or you can use ManOpen by Carl Lindberg to lookup and print any man page. ManOpen was first developed for NeXtStep and still works thanks to Carl.


2

gtime can't execute/time commands definied internally by the shell. Commands are executed using the exec() system call, but the system call basically only knows about commands with binaries (e.g. in /usr/bin). Builtin commands are included in the shell binary, there is no way for exec() to execute them. You need to either find a way to execute the command ...


2

The issue is caused by BSD split being later in your path than the GNU split (which doesn't support the -p option). If you do an echo $PATH you should see this - /usr/local/opt/coreutils/libexec/gnubin will be before /usr/bin in the output. To call BSD split directly, use the full path - pipe to /usr/bin/split instead of split. Your original command will ...


2

In response to your first and easy question, yes, your HDD is dying and needs to be replaced ASAP. Now is a good opportunity to change it to an SSD. Here is a good video on YouTube that shows you how. I am not sure why you would use dd to fix bad blocks/sectors when DiskUtility has a more robust solution. Boot into recovery mode by holding Command-R (or ...


2

It depends on the type of data being cached - is it per user or system wide? If per user, there's nothing wrong with using a dot-prefixed directory in the user's home directory (that's what it's for, after all, and very much the UNIX way) or perhaps /tmp/<username> if the data is not to be persisted. If it's system wide and meant to be persisted, ...


2

In addition to HISTFILESIZE, you also need to set HISTSIZE, which controls the number of commands to keep in memory until they are saved. Also, the manual page for history is available via man bash. Scroll down to SHELL BUILTIN COMMANDS, and you'll find it. The details about HISTSIZE and other variables are further up in the same manual page.


2

Your script above is running two different scripts. One is changing the working directory to your user desktop folder (~/Desktop). The other script is downloading www.google.com and putting it in a document in your root directory (/), which doesn't have permissions to do so. You can fix this by reduce it to one statement of do shell script like such: do ...


1

In a Terminal type echo $PATH and press Enter. It will display your PATH Environment Variable. Example: $ echo $PATH $ /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin $ While you could place it in any of the locations listed nonetheless it's a good suggestion that you place it in /usr/local/bin as the other locations are used by the OS. In a Terminal ...


1

The usual Unix way for your scripts is /usr/local/bin for scripts that all users on the system can use and if for only you then in somewhere under your home directory often ~/bin You need to make sure both of these directories art on your PATH environment variable preferably before system paths do if your write a script with the same one as a system one ...


1

On BSD systems, the sysctl utility can provides similar information as the /proc tree in Linux. It actually report some CPU/GPU temperature information from Xnu CPU Power Management (XCPM): sysctl machdep.xcpm.cpu_thermal_level sysctl machdep.xcpm.gpu_thermal_level However this doesn't seem to be a temperature reading but only an indication of the ...


1

Wish I could claim credit for this one, but I found it buried in https://github.com/chcokr/osx-init/blob/master/install.sh This worked on my 10.10 headless VM without a logged in UI. touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress; PROD=$(softwareupdate -l | grep "\*.*Command Line" | head -n 1 | awk -F"*" '{print $2}' | sed -e ...


1

You can install coreutils with Macports as sudo port install coreutils This will gone GUN's core utils in /opt/local/bin with a h prepended e,g gshuf


1

split operates on multiple line files not on a single line file or string. In the example below I'm using jot because seq in not on my system. Also I'm using BSD sed with an addition that changes the marker 060 to a colon. This produces the string 0102030405:7080910. We add the 060 back into the second file. jot -w "%02d" 10 1 ...


1

Generally speaking installing XCode and/or the command line tools should have added those paths to your shell path variable. Odd that it didn't. Perhaps someone with more familiarity with XCode can help with that. You could just type the whole path to the app every time you want to use it. But that would be a PITA. Adding the path to those apps does not ...


1

In this solution we need to tell ssh to create a pseudo terminal with -tt then use a heredoc to send the commands to the remote location. ssh -tt user@domain.com <<EOF cd /var/www/website/ git pull logout EOF



Only top voted, non community-wiki answers of a minimum length are eligible