Python Forum
Difference between os.system("clear") and os.system("cls")
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Difference between os.system("clear") and os.system("cls")
#5
clear is a linux command.
deadeye@nexus ~ $ which clear                                                                                                   
/usr/bin/clear
deadeye@nexus ~ $ file /usr/bin/clear                                                                                           
/usr/bin/clear: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=125b29469045b30adcd4c134b9cf8e287ba13bea, stripped
deadeye@nexus ~ $  
I use always CTRL + L, if I use the terminal.

cls is and was always the command on MS-Systems to clear the screen.
The command was introduced with DOS.
So after the hell was frozen (Microsoft has a Linux Subsystem), they come closer to Linux.
They added support for SSH, Unix-Sockets. They offer different Linux Distributions for the Linux Subsystem.
They bought github. I guess the next step would be, to buy Canonical.

For compatibility reasons, you would see more and more supported GNU Linux commands on Windows.
The Powershell is on Windows, what /bin/bash is on Linux. But it's nice to have an intersection of commands in both worlds.



The return code comes from the started process itself. 0 == OK
The retval 1 comes not from 'clear', because it's not there. I think the invoked command/library/syscall
returns this value, if a command was not found. I don't use windows very often, so my knowledge how
processes on widows are started, is very limited.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Messages In This Thread
RE: Difference between os.system("clear") and os.system("cls") - by DeaD_EyE - Jun-16-2019, 04:08 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  FileNotFoundError: [WinError 2] The system cannot find the file specified NewBiee 2 1,621 Jul-31-2023, 11:42 AM
Last Post: deanhystad
  Os.system("shutdown"); command not found cosmin1805 4 1,739 Nov-13-2022, 02:07 PM
Last Post: cosmin1805
  [split] Please help with menu system dvejsa 4 1,316 Sep-13-2022, 08:01 PM
Last Post: dvejsa
  Alarm system with state, class, enum. Frankduc 0 1,282 May-04-2022, 01:26 PM
Last Post: Frankduc
  simulation of alarm system Frankduc 6 1,694 Apr-21-2022, 03:45 PM
Last Post: Frankduc
  Python Flask Realtime system printout (console) ffmpeg jttolleson 3 2,982 Apr-18-2022, 06:39 PM
Last Post: jttolleson
  Avoid third party functions to wrote my python code into system debug-log? mark 9 2,241 Apr-09-2022, 08:41 PM
Last Post: mark
  Help with multi-window system garynewport 3 2,548 Mar-16-2022, 03:05 AM
Last Post: deanhystad
  Advice for Inventory System Extra 0 1,340 Feb-18-2022, 09:25 PM
Last Post: Extra
  Need Help With Python RPG Battle System SBanya 1 6,517 Nov-01-2021, 10:38 PM
Last Post: Garudyne

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020