Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Shell Scripting
  • Kali Linux
  • Ubuntu
  • Red Hat
  • CentOS
  • Docker in Linux
  • Kubernetes in Linux
  • Linux interview question
  • Python
  • R
  • Java
  • C
  • C++
  • JavaScript
  • DSA
Open In App
Next Article:
Commands in Unix when things go wrong
Next article icon

Commands in Unix when things go wrong

Last Updated : 30 Jan, 2019
Comments
Improve
Suggest changes
Like Article
Like
Report
Terminals and keyboards has no uniform behavioral pattern. There are some commands to wriggle out of some common traps. You must know which keys you need to press when things don't quite work as expected. 1. Backspacing doesn't work: Consider you misspelled command stty as ssty and when you press backspace to erase the command, an unexpected symbol(^?) are printed:
  $ stty^?^?^?^?^?^?^?  
Backspacing is not working here, that's why ^? is printed whenever we pressed backspace. To get rid of this unexpected behavior, we can use any of the following keys:
  [Ctrl-c] OR [Delete]  
2. Killing a line: If a command line contains many mistakes, a person will prefer to kill or erase the line instead of executing it. For this we have to press:
  [Ctrl-u]
Above command kills everything in a line and returns the cursor to the beginning of the line. 3. Interrupt command: Sometimes a program goes into infinite loop. We can interrupt the program and bring back the prompt by using either of the following keys:
  [Ctrl-c] OR [Delete]  
This a important command and always recommended to use this in case of anything goes wrong. NOTE: If delete works as a erase character on your machine then it doesn't work as interrupt key at the same time. 4. Terminating command's input: As we know that cat command require at least one filename as an argument. What will happen if we doesn't give any file name as an argument and simply press enter:
  $ cat  ..  
Nothing happens, terminal waits for us to enter something. To bring back the prompt, in case of commands that expect user input, either of the following keys are used:
  [Ctrl-d] OR [Ctrl-c]  
5. Lock Keyboard: For locking the keyboard, [Ctrl-s] command is used. After this you wouldn't able to insert anything on the terminal. For restoring keyboard normal operation, [Ctrl-q] command is used. 6. When [Enter] key doesn't work: Enter key is used to complete the command line or to run the command. If this doesn't work, we can use any of the following commands:
  [Ctrl-j] OR [Ctrl-m]  
These keys generate the linefeed and carriage return characters respectively. Don't surprised if some of the commands behaves differently in your system. Much of the Unix is configurable by the user, you can use stty command to change these settings. References: Unix Concepts And Applications - Das, Sumitabha

Next Article
Commands in Unix when things go wrong

A

AKASH GUPTA 6
Improve
Article Tags :
  • Misc
  • Linux-Unix
  • linux-command
Practice Tags :
  • Misc

Similar Reads

    Sed Command in Linux/Unix With Examples
    The SED command (short for Stream Editor) is one of the most powerful tools for text processing in Linux and Unix systems. It's commonly used for tasks like search and replace, text transformation, and stream editing.With SED, you can manipulate text files without opening them in an editor. This mak
    8 min read
    while Command in Linux with Example
    The "while" command is a powerful tool in the Linux shell that allows you to execute a series of commands repeatedly based on a given condition. It is commonly used in shell scripts to create loops, where a block of code is executed as long as a particular condition remains true. Basic Syntax of Whi
    6 min read
    Fun Commands in Linux
    Linux isn't just for coding and administration—it can also be a lot of fun. With a variety of terminal commands, you can add some entertainment to your Linux experience. Below is a list of some cool and fun commands you can use in Linux to enhance your terminal experience. We’ll also cover how to in
    3 min read
    Essential Unix Commands
    Unix commands are a set of commands that are used to interact with the Unix operating system. Unix is a powerful, multi-user, multi-tasking operating system that was developed in the 1960s by Bell Labs. Unix commands are entered at the command prompt in a terminal window, and they allow users to per
    7 min read
    if command in linux with examples
    if command in Linux is used for conditional execution in shell scripts.The if command is essential for writing scripts that perform different actions based on different conditions.if COMMANDS list is executed, if its status is true, then the then COMMANDS list is executed. Otherwise, each elif COMMA
    4 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences