Txt

Byte sized tech know-how.

  • Home
  • About

Tag Archives: delete

12 May

Delete Leading Whitespace Using Sed

Delete leading whitespace (spaces/tabs/etc) from beginning of each line. Same as yesterday’s command – but using sed


cat file.txt | sed -e 's,^ *,,'

Credit: Vivin

admin Posted in Command Line, Linux command, delete, leading, Linux, sed, whitespace Leave a comment
11 May

Delete Leading Whitespace

Delete leading whitespace (spaces/tabs/etc) from beginning of each line


ruby -pe 'gsub(/^\s+/, "")' < file.txt
admin Posted in Command Line, Linux, Ruby command, delete, filler, line, Linux, whitespace 1 Comment
01 Sep

Delete all \n chars in a file…

Delete all \n chars in a file…


tr -d "\n" 
admin Posted in Command Line, Linux command, delete, line, Linux, new, newline, slashn, text, tr Leave a comment
24 Jul

Delete User

Delete a user ( ‘-r’ eliminates home directory)


userdel -r user1 
admin Posted in Command Line, Linux command, delete, Linux, remove, user, userdel 1 Comment
07 Jul

Remove SVN Info from a Folder

This command removes the SVN data from a folder.


find -name .svn -exec rm -rf {} \;
admin Posted in Code, Command Line, Linux delete, find, remove, subversion, svn 2 Comments
15 Apr

Remove all EXE files

Removes all exe files in the current directory tree. Useful to clear virus from flash drives.


find . -name "*.exe" -delete
admin Posted in Command Line, Linux command, delete, exe, find, Linux, virus, windows 5 Comments
23 Mar

Uninstall Using Yum

Use this command to remove a rpm package.


yum remove package_name
admin Posted in Command Line, Linux delete, package, remove, uninstall, yum Leave a comment
22 Feb

Force delete a file

Force delete a file


rm -f file
admin Posted in Command Line, Linux command, delete, force, Linux Leave a comment
12 Feb

Remove Empty Lines and Comments

Remove comments and blank lines from example.pl


sed '/ *#/d; /^$/d' example.pl
admin Posted in Command Line, Linux, Perl comments, commnad, delete, Linux, sed Leave a comment
13 Sep

Remove empty directories

Remove all empty directories within the current directory


find . -type d -empty -exec rmdir {} \;
perl -MFile::Find -e"finddepth(sub{rmdir},'.')"

Delete Empty Directories
http://www.jonasjohn.de/lab/red.htm
[tags]empty,folder,delete,remove,perl,command,linux[/tags]

admin Posted in Command Line, Linux, Perl command, delete, empty, folder, Linux, Perl, remove Leave a comment

Post navigation

Categories

  • Code
  • Command Line
  • Configuration
  • CSS
  • HTML
  • internet
  • JavaScript
  • Linux
  • Mobile
  • Perl
  • PHP
  • Python
  • Ruby
  • Uncategorized

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Fruitful theme by fruitfulcode Powered by: WordPress
↑