Difference between revisions of "Shell"

From Wiki at Neela Nurseries
Jump to: navigation, search
m (minor correction)
m
Line 4: Line 4:
 
How to produce a usable filename which contains <ESC> characters, and to rename that badly named file:
 
How to produce a usable filename which contains <ESC> characters, and to rename that badly named file:
  
 +
  $ ls -i
 +
  9704871 ''$'\033\033'  9703029  CMakeLists.txt  10899590  dts          9708845  samples
 
   $ ls -q `find . -inum 9704871`
 
   $ ls -q `find . -inum 9704871`
 
   './'$'\033\033'
 
   './'$'\033\033'
 
   $ mv './'$'\033\033' betterfilename
 
   $ mv './'$'\033\033' betterfilename

Revision as of 18:58, 8 August 2023

Shell Scripting


How to produce a usable filename which contains <ESC> characters, and to rename that badly named file:

 $ ls -i
 9704871 $'\033\033'   9703029  CMakeLists.txt  10899590  dts          9708845  samples
 $ ls -q `find . -inum 9704871`
 './'$'\033\033'
 $ mv './'$'\033\033' betterfilename