Skip to content
CyberWar.ro
  • Home
  • Countries
  • CERTs / CSIRTs Updates
  • Tools
    • IP Converter
    • CyberChef
    • HTTP Headers
    • View Source
    • Favicon Hashes
  • Resources
    • Bookmarks
    • News
    • Publications
    • Dictionary
    • Abbreviations
  • Contact

Code Snippets

Command not found while using sudo

January 1, 2022 by TheNewbie

sudo -E env “PATH=$PATH” [arguments] OR alias mysudo=’sudo -E env “PATH=$PATH”‘

Categories Code Snippets Leave a comment

Install gcc and more on Ubuntu 20.04

January 1, 2022 by TheNewbie

Run: sudo apt update sudo apt install build-essential followed by: sudo apt-get install manpages-dev

Categories Code Snippets Leave a comment

#BashFu – How to delete empty files

July 20, 2020 by TheNewbie

Are you left with a bunch of files that are empty? Run this and delete them: find . -empty -type f | xargs rm

Categories Code Snippets Leave a comment

#BashFu – How to wget a list of URLs and keep original file names

July 20, 2020July 17, 2020 by TheNewbie

So you have a list of URLs that redirect to downloads (Excel Files, Word Documents, etc) Use this to download all of them and keep the original filename: wget –content-disposition –trust-server-names -i list_of_urls.txt source

Categories Code Snippets Tags bashfu Leave a comment

#BashFu – Find lines that are in one file but not in another file

July 15, 2020July 15, 2020 by TheNewbie

Say you have this setup:

fileA

carrot
cake
tomato

fileB

bread
cake
croissant

To get the lines that are in FileA but not in FileB you can run:
diff fileB fileA | grep '^>' | sed 's/^>\ //'

to get:

carrot
tomato

Categories Bookmarks, Code Snippets Leave a comment

#BashFu – How to Uppercase/Lowercase text with sed

July 20, 2020July 15, 2020 by TheNewbie

Uppercase Text with sed

sed 's/[a-z]/\U&/g'

Lowercase Text with sed

sed 's/[A-Z]/\L&/g'

Categories Bookmarks, Code Snippets Tags bash, Linux, notes Leave a comment

Code Snippets #1: clone existing website with wget

July 15, 2018 by TheNewbie

wget -U “Mozilla/5.0 (X11; U; Linux; en-US; rv:1.9.1.16) Gecko/20110929 Firefox/3.5.16” –recursive –level=1 –no-clobber –page-requisites — html-extension –convert-links –no-parent –wait=3 –random-wait http://www.example.com/docs/interesting-part/ –domains=www.example.com

Categories Bookmarks, Code Snippets Tags wget Leave a comment
  • Privacy and Cookie Policy (EU)
© 2026 CyberWar.ro • Built with GeneratePress
Manage Cookie Consent
We use technologies like cookies to store and/or access device information. We do this to improve browsing experience and to show (non-) personalized ads. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
View preferences
{title} {title} {title}