Tag Info

Hot answers tagged

21

You can use brace expansions: convert -trim -density 400 this_is_a_very_long_filename_of_my_pdf_file.{pdf,png}


9

The best way to do this is a Dynamic Range Compressor. Audacity has one built-in, under "Filters->Compressor." This is, essentially, a program that removes the range between quiet sounds and loud sounds. It's surprisingly easy to use. Set the "Threshold" value to something very low. Set the "Noise floor" to around -30DB. Set the ratio to a very high ...


5

If you always use the same command with small variations (such as the file name), you can write a function: pdf2png() { convert -trim -density 400 "$1" "$1:r.png" } (this function is specific to zsh), and for each file your_file.pdf you want to convert: pdf2png your_file.pdf Note 1: You can write the same kind of function for other shells, but this is ...


4

From the ping manpage (emphasis mine): When the specified number of packets have been sent (and received) or if the program is terminated with a SIGINT, a brief summary is displayed. Shorter current statistics can be obtained without termination of process with signal SIGQUIT. So this will work if you're fine with your stats being slightly less ...


4

This call to mogrify will create a new png file instead of overwriting the pdf - hopefully ;) mogrify -trim density 400 -format png th*.pdf for th*.pdf use the aprropriate number of characters to select the right file or better tab completion until you have the full name. This way you can make an alias to the whole command up to the png parameter.


4

The curses program tabs will allow you to change what the terminal believes to be the width of a ^I. This would make a simple script tabs -4 cat "$@" tabs -8 However, the processing of tab characters on terminals is notoriously wonky and I'm of the impression that you should never mess with them. I suggest using expand as in: expand -4 "$@" which is ...


4

You started writing a string literal: everything between ' and the next ' is treated as a single "thing" by the shell, including newlines, spaces, and any other characters. Here you wrote a string containing two newlines. That meant that the first thing on the line was \n\n (two newlines). Because the first thing on a line is always the command to run, the ...


3

You can pass the [[:blank:]] character class to tr to delete spaces and tabs but retain newlines <file tr -d '[[:blank:]]'


3

You should be able to use tr, but not as specified on the page your link points to as that includes the removal of newline and carriage return. What you should do is: tr -d " \t" < infile.txt > outfile.txt


3

You can use info command to know more details about any command in coreutils. Here is some portion in info ls, explain the -l option: `-l' `--format=long' `--format=verbose' In addition to the name of each file, print the file type, file mode bits, number of hard links, owner name, group name, size, and timestamp (*note Formatting file ...


3

Consider using variables to store your filenames. They autocomplete too: f="this_is_a_very_long_filename_of_my_pdf_file" convert -trim -density 400 "$f.pdf" "$f.png" I use quotes because sometimes spaces bite. Significant benefits of this are: You can perform further operations with the value in $f, knowing it points to the right file It is the ...


2

A direct way to do it: vim ~/.bashrc && source $_ You can make an alias: alias vimbashrc='vim ~/.bashrc && source $_' This works in bash or zsh. In other shell, you must explicit name .bashrc to source to make it work: alias vimbashrc='vim ~/.bashrc && source ~/.bashrc'


1

sudo yum install foo will look for foo in the package repositories and install it if it exists. Sometimes the name of packages is not obvious, so you may want to use yum search foo to see if there are any packages available pertaining to "foo". man yum will give you some details about the packaging program.


1

With bash 4 mapfile -t <list paste "${MAPFILE[@]}" | column -s $'\t' -t for the paste {list}/PQR/A/sum version of the question mapfile -t <list paste "${MAPFILE[@]/%//PQR/A/sum}" | column -s $'\t' -t


1

If all your files is in single directory, just use: paste * | column -s $'\t' -t If you have a list file contains all files, and each file name in one line, does not have special characters like space, you can try: paste $(printf "%s " $(cat list)) | column -s $'\t' -t Updated With your updated information, you can try: paste */PQR/A/sum | column -s ...


1

Using brace expansion cannot be beaten for this special example. However, a little more flexible is the zle widget copy-prev-shell-word, which does what it's name suggests and is handy if you want a similar argument as the previous, which cannot systematically derived from it. Bind the widget e.g. to CTRL+W: bindkey '^W' copy-prev-shell-word If you are ...


1

You can also use History Expansion to refer to words on the current command line: convert -trim -density 400 this_is_a_very_long_filename_of_my_pdf_file.pdf !#:$:r.png Event designator !# refers to the command line typed so far Word designator $ indicates the last word (before the expansion) Modifier r removes the file extension. This also marks the end ...



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