Commands tagged bookmarks (9)

  • 14
    curl -u username -o bookmarks.xml
    avi4now · 2009-04-06 13:54:15 3
  • Found this useful query at The b.parent=2 in the command refers to the bookmarks folder to extract. See the source webpage for additional info.

    sqlite3 ~/.mozilla/firefox/*default/places.sqlite "select a.url, a.title from moz_places a, moz_bookmarks b where and b.parent=2;"
    jrdbz · 2013-04-12 17:41:34 1
  • pushd and popd are your friends, but sometimes they're just incompatible with the way one works... Two shell functions: bm bookmarkname - "bookmarks" the current directory, just 'cd $BMbookmarkname' to return to it. forget bookmarkname - unsets the 'bookmarkname' variable. It isn't mandatory, they cease to exist when the session ends. Show Sample Output

    bm() { export BM${1?"bookmark name missing"}="$PWD" ; }; forget() { unset BM${1?"bookmark name missing"} ; }
    unefunge · 2010-11-19 12:15:11 0
  • Extracts yours bookmarks out of sqlite with the format: dateAdded|url Show Sample Output

    sqlite3 ~/.mozilla/firefox/*.[dD]efault/places.sqlite "SELECT strftime('%d.%m.%Y %H:%M:%S', dateAdded/1000000, 'unixepoch', 'localtime'),url FROM moz_places, moz_bookmarks WHERE = ORDER BY dateAdded;"
    return13 · 2015-03-08 19:26:16 0
  • for i in $(ls /home/marco/.mozilla/firefox/*\.*/places.sqlite); do sqlite3 $i "SELECT strftime('%d.%m.%Y %H:%M:%S', dateAdded/1000000, 'unixepoch', 'localtime'),url FROM moz_places, moz_bookmarks WHERE = ORDER BY dateAdded;"; done

    "SELECT strftime('%d.%m.%Y %H:%M:%S', dateAdded/1000000, 'unixepoch', 'localtime'),url FROM moz_places, moz_bookmarks WHERE = ORDER BY dateAdded;"; done
    weirdname · 2016-05-19 02:09:17 1
  • 1. First we get the `item_id` for that `comment`. Adapt the -C[N] parameter for your use. 2. Then we show the bookmark's `title` (or `url`). With that in your hand it's a matter of seconds to open Firefox's library and find the bookmark. Handy for eg. forensics or better sanitize of a place.sqlite before sharing it (on the cloud). It sure has room for improvement. Show Sample Output

    sqlite3 -list places.sqlite 'SELECT item_id, content FROM moz_items_annos ;' | grep -A9 "string" ; sqlite3 places.sqlite 'SELECT title FROM moz_bookmarks WHERE .fk = <item_id number> ;'
    datruche · 2015-10-31 19:32:52 0
  • # Usage: ftagmarks TAG BOOKMARKS.JSON ftagmarks Bash ~/.mozilla/firefox/*.default/bookmarkbackups/bookmarks-*.json Tag can be partial matching, e.g. input 'Bas' or 'ash' will match 'Bash' tag. # Exact tag matching: ftagmark(){ jq -r --arg t "$1" '.children[] as $i|if $i.root == "tagsFolder" then ([$i.children[] as $j|{title: ($j.title), urls: [$j.children[].uri]}]) else empty end|.[] as $k|if $k.title == $t then $k.urls else empty end|.[]?' "$2"; } Usage: ftagmark TAG BOOKMARKS.JSON # List all tags: ftagmarkl(){ jq -r '.children[] as $i | if $i.root == "tagsFolder" then $i.children[].title else empty end' "$1"; } Usage: ftagmarkl BOOKMARKS.JSON # Requires: `jq` - must have CLI JSON processor Show Sample Output

    ftagmarks(){ jq -r --arg t "$1" '.children[] as $i|if $i.root == "tagsFolder" then ([$i.children[] as $j|{title: ($j.title), urls: [$j.children[].uri]}]) else empty end|.[] as $k|if ($k.title|contains($t)) then $k.urls else empty end|.[]?' "$2"; }
    qwertyroot · 2016-12-24 15:12:04 0
  • If you add the bookmarklet to your browser's bookmarks with like say, the keyword 'cfu', you can for example type 'cfu hello' in the location bar and the %s gets replaced with 'hello'. The bookmarklet will convert the search text to base64 for use with the commandlinefu website and will take you there. Tested with Firefox. Show Sample Output

    echo "javascript:location.href=''+encodeURIComponent('%s')+'/'+btoa('%s')+'/sort-by-votes'"
    darkfader · 2011-03-07 22:01:46 0

  • -6
    bm () { ... see description }
    Wonko7 · 2010-11-19 13:37:19 3

What's this? 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

Open a file at the specified line
You may also use +line:column syntax.

Run bash on top of a vi session (saved or not saved), run multiple commands, instead of one at a time with :!(bashcommand), type exit and [enter] to get back to where you left off in vi.
Helps when I'm editing a script and want to double check some commands without having to exit out of vi multiple times or having to use another terminal session.

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" }

Number of CPU's in a system
/proc/cpuinfo contains information about the CPU. Search for "processor" in the /proc/cpuinfo file wc -l, counts the number of lines.

Clean up after a poorly-formed tar file
These days, most software distributed in tar files will just contain a directory at the top level, but some tar files don't have this and can leave you with a mess of files in the current folder if you blindly execute $ tar zxvf something.tar.gz This command can help you clean up after such a mistake. However, note that this has the potential to do bad things if someone has been *really* nasty with filenames.

Check if your desired password is already available in haveibeenpwnd database. This command uses the API provided by HIBP

add files to existing growable DVD using growisofs
replace "directory name with files to add to DVD" with actual directory containing files you want to add to growable DVD

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

LVM2 Reduce
Just the commands for the lvreduce I keep forgetting.

convert a mp4 video file to mp3 audio file (multiple files)

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.


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: