Kali linux shell script

How to execute shell script on Kali Linux startup?

I need to execute a shell script on a Kali Linux startup. I am using 2016.1 version of Kali Linux. i tried many things like rc.local , init.d , X11 and GDM3 config etc. but I couldn’t get it work. This is the shell script that I want to execute:

#!/bin/bash xrandr --newmode 1366x768 85.500 1366 1494 1624 1798 768 770 776 795 +hsync -vsync xrandr --addmode VGA-0 1366x768 xrandr --output VGA-0 --mode 1366x768 

Is the file executable? Can you run it from an interactive shell? What did you try wth your different approaches (which files did you edit how)?

can you place the script in /etc/profile.d/ ? Any script in that directory should run when you log in. Or maybe put it in /etc/bashrc ?

3 Answers 3

You can add an item in ~/.config/autostart ,

e.g Open ~/.config/autostart/myscript.desktop , and paste the following contents

[Desktop Entry] Name=MyScript GenericName=A descriptive name Comment=Some description about your script Exec=/path/to/my/script.sh Terminal=false Type=Application X-GNOME-Autostart-enabled=true 

And make sure the script is executable.

@reboot :EXAMPLE: @reboot macchanger -r eth0 (I got this from a video so im giving credit where credit is due) https://www.youtube.com/watch?v=OcVE6rQ9_FU 04:38:57

Читайте также:  Alt linux установка второй системой

I see you’re attempting to force a custom resolution in your monitor in every boot.

I have not used Kali Linux myself, but I’m willing to guess you could add the commands to an .xprofile file in your home directory, as most display managers would run the content of the file when initializing.

If you don’t have this file in your home directory, just create it, paste your commands in it, save it and reboot. You can see more about this in this article from the ArchWiki.

You must log in to answer this question.

Hot Network Questions

Subscribe to RSS

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.7.14.43533

Linux is a registered trademark of Linus Torvalds. UNIX is a registered trademark of The Open Group.
This site is not affiliated with Linus Torvalds or The Open Group in any way.

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Источник

hacking by kali linux

It is the easiest and funniest task how to create and run shell script in linux.
It gives lots of handful tools to us.

The shell script file can be transferred from one computer to another very easily.
By using it, we can store our code upto the time we want.

Let’s start with an example

      create shell file to display all text files on Desktop.
      Open any text editor say, leafpad then write the code.
      Code is:
    • for i in *.txt
    • do
    • echo $i
    • done

    how to create and run shell script in linux

    • Open up the terminal,and write command root@kali:~# cd /Desktop
    • root@kali:~/Desktop# chmod u=x shell_script.sh
      It gives permission to the shell script to be executable by users.
    • root@kali:~/Desktop# ./shell_script
      ./ is used before the name of shell script to run it
    • Mine output is : iaminfinity.txt
      iaminnovator.txt
      iammoneymagnate.txt
      iamtheking.txt
      iamtheleader.txt
    • create the file with extension .sh
    • then give the file permission to get executed by the user
      chmod u=x any_file.sh
    • then run the file by ./any_file.sh

    6 comments:

    If you think your spouse may be cheating, you can contact PHONESPYAPPS1@GMAIL.COM
    He’s a real hacker and was very reliable in helping me spy on my cheating husband’s cell phone remotely.
    Reply Delete

    I was diagnose with human papilloma virus (HPV) 4 years ago and i met a doctor he told me there is no cure and i have be taking some medication the warts multiplied when trying to removed them and it got me embarrass and pains, luckily few weeks ago i was recommend to Dr Onokun for natural treatment after one week i got 100% cure and all the wart and pains got disappeared, i sheared this post because its part of my life experience, encase anyone need speedy help about this cure email Dr Onokun via, dronokunherbalcure@gmail.com Reply Delete

    I got my already programmed and blanked ATM card to withdraw the maximum of $5,500 daily for a maximum of 6 years. I am so happy about this because i got mine last week and I have used it to get more then $350,000 and ready to pay more. United Hackers is giving out the card just to help the poor and needy though it is illegal but it is something nice is not like other scam pretending to have the blank ATM cards. And no one gets caught when using the card.
    WhatsApp: +351 965 761 372
    Email : unitedblankatmhackcard@gmail.com Reply Delete

    Are you interested in the service of a hacker to get into a phone, facebook account, snapchat, Instagram, yahoo, Whatsapp, get verified on any social network account, increase your followers by any amount, bank wire and bank transfer. Contact him on hackintechnology@gmail.com +12132951376(WHATSAPP) Reply Delete

    Do you need to increase your credit score?
    Do you intend to upgrade your school grade?
    Do you want to hack your cheating spouse Email, whatsapp, Facebook, instagram or any social network?
    Do you need any information concerning any database.
    Do you need to retrieve deleted files?
    Do you need to clear your criminal records or DMV?
    Do you want to remove any site or link from any blog?
    you should contact this hacker, he is reliable and good at the hack jobs..
    contact : cybergoldenhacker at gmail dot com
    Reply Delete

    Selling USA FRESH SSN Leads/Fullz, along with Driving License/ID Number with good connectivity.

    **PRICE FOR ONE LEAD/FULLZ 2$**

    All SSN’s are Tested & Verified. Fresh spammed data.

    ->FULL NAME
    ->SSN
    ->DATE OF BIRTH
    ->DRIVING LICENSE NUMBER
    ->ADDRESS WITH ZIP
    ->PHONE NUMBER, EMAIL
    ->EMPLOYEE DETAILS

    ->Bulk order negotiable
    ->Minimum buy 25 to 30 leads/fullz
    ->Hope for the long term business
    ->You can asked for specific states too

    Источник

Оцените статью
Adblock
detector