#!/bin/sh ## ## NAUTILUS ## SCRIPT: 00_anyfile_list_binDIRfiles_ls.sh ## ## PURPOSE: Lists the files currently in the main system ## 'bin' directories --- /bin, /sbin, /usr/bin, etc. ## ## METHOD: The 'ls' command is applied the the several bin directories. ## ## The output is concatenated to a text file. ## ## This text file is shown using a text-file viewer of the ## user's choice. ## ## HOW TO USE: In the Nautilus file manager, click on the name of ANY file ## (or directory) in a Nautilus directory list. ## Then right-click and choose this script to run (name above). ## ## Created: 2010apr04 ## Changed: 2011may02 Add $USER to temp filename. ## Changed: 2011may11 Get 'nautilus-scripts' directory via an include script. ## Changed: 2012feb29 Changed the script name in the comment above. ## FOR TESTING: (show statements as they execute) # set -x ############################################################### ## Prep a temporary filename, to hold the list of filenames. ## We put the output file in /tmp, in case the user ## does not have write-permission in the current directory. ############################################################### OUTFILE="/tmp/${USER}_list_binFiles.lis" if test -f "$OUTFILE" then rm -f "$OUTFILE" fi ##################################### ## Prepare the HEADER for the listing. ##################################### THISHOST=`hostname` echo "\ ................ `date '+%Y %b %d %a %T%p %Z'` ...................... List of Files (mostly executables) in main 'bin' directories --- on host: $THISHOST Some more information is at the bottom of this list. ------------------------------------------------------------------------------ " > "$OUTFILE" ##################################### ## Prepare the 'guts' of the listing. ##################################### echo " #### /bin: #### " >> "$OUTFILE" ls /bin >> "$OUTFILE" echo " ##### /sbin: ##### " >> "$OUTFILE" ls /sbin >> "$OUTFILE" echo " ######## /usr/bin: ######## " >> "$OUTFILE" ls /usr/bin >> "$OUTFILE" echo " ######### /usr/sbin: ######### " >> "$OUTFILE" ls /usr/sbin >> "$OUTFILE" echo " ############## /usr/local/bin: ############## " >> "$OUTFILE" ls /usr/local/bin >> "$OUTFILE" ##################################### ## Prepare the TRAILER of the listing. ##################################### SCRIPT_BASENAME=`basename $0` SCRIPT_DIRNAME=`dirname $0` echo " ------------------------------------------------------------------------------ The list above was generated by the script $SCRIPT_BASENAME in directory $SCRIPT_DIRNAME The list was created with the 'ls' command applied to directories /bin /sbin /usr/bin /usr/sbin /usr/local/bin If you want to change or add some directories, you can simply edit the script. ------------------------------------------------------------------------------ FOR MORE INFO ON THESE EXECUTABLES: For some of these executables, you can type 'man ' to see details on how the program can be used. ('man' stands for Manual. It gives you the user manual for the command/utility.) You can type 'man man' at a shell prompt to see a description of the 'man' command. Or use the 'show_manhelp_4topic' Nautilus script in the 'LinuxHELPS' group of Nautilus scripts. --- Some executables --- like firefox (web browser) and thunderbird (email reader) and ooffice (word processing, spreadsheet, presentation editor) --- have their own help built into them. --- For even more wide-ranging lists of executables on this machine, go to the 'FINDtools' group of Nautilus scripts, and use the script 'findfils4type_underThisDir' --- and specify type 'executable'. That list can take more time to generate because it may search through many more directories and files on the machine. Best not to use it at a high-level directory like '/' or at a directory under which you know there are tens of thousands of files. ******* END OF LIST of most of the 'bin' files on host $THISHOST ******* " >> "$OUTFILE" ####################################### ## Show the listing. ####################################### ## . $HOME/.gnome2/nautilus-scripts/.set_VIEWERvars.shi . $HOME/.freedomenv/feNautilusScripts/set_DIR_NautilusScripts.shi . $DIR_NautilusScripts/.set_VIEWERvars.shi $TXTVIEWER "$OUTFILE" &