Commands tagged accents (3)

  • Slug the part of an URL which identifies a page using human-readable keywords. Slugs are used to construct friendly URLs (often for permalinks) that are easy to type, descriptive, and easy to remember. Show Sample Output


    1
    function slugify() { tr '[:upper:]' '[:lower:]' <<< "$(sed -z -r -e 's~[^[:alnum:]]+~ ~g' -e 's~^ *~~;s~ *$~~' -e 's~ +~-~g' - <<< "$(iconv -c -t ASCII//TRANSLIT//IGNORE - <<< "$@" )")"; }
    mikhail · 2019-06-08 17:45:57 42
  • If we've many files containing (?, ?, ?, ?, ? ) characters instead of ?, ?,... etc,... we can ue this simple command line running a sed command inside a for loop searching for files containing that characters. Hope u like it! Enjoy! ;) Show Sample Output


    0
    for i in `grep -ri "?\|?\|?\|?\|?" * --col | cut -d: -f1 |sort -u `;do sed -i "s/?/\&aacute;/g" $i; sed -i "s/?/\&eacute;/g" $i; sed -i "s/?/\&iacute;/g" $i; sed -i "s/?/\&oacute;/g" $i; sed -i "s/?/\&uacute;/g" $i; echo "HTMLizing file [$i]";done
    linuxninja · 2014-04-24 11:43:36 6

  • -2
    IFS=?" ; for i in * ; do mv -v $i `echo $i|tr ???????????????????\ aaaeeiooAAAEEIOOOcC_` ; done
    valessiobrito · 2011-08-11 04:20:55 4

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands


Check These Out

List all NPM global packages installed

Convert seconds to [DD:][HH:]MM:SS
Converts any number of seconds into days, hours, minutes and seconds. sec2dhms() { declare -i SS="$1" D=$(( SS / 86400 )) H=$(( SS % 86400 / 3600 )) M=$(( SS % 3600 / 60 )) S=$(( SS % 60 )) [ "$D" -gt 0 ] && echo -n "${D}:" [ "$H" -gt 0 ] && printf "%02g:" "$H" printf "%02g:%02g\n" "$M" "$S" }

Use Linux coding style in C program
put "-linux" option into $HOME/.indent.pro to make it default

Set OS X X11 to use installed Mathematica fonts

drop first column of output by piping to this

Capture FTP Credentials and Commands

output length of longest line
If your wc does not have the -L option, you can use awk.

multiline data block parse and CSV data extraction with perl
extract data in multiline blocks of data with perl pattern matching loop

Kill all processes belonging to a user

Google URL shortener
Shorter and made into a function.


Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: